IPad - Popover Frame Color

So, I have a split view application that I am working on and have encountered a strange user interface error. Here is my best attempt to explain this. If I download the application in landscape mode, the top navigation bar of the root controller will be the correct color. I do this in the rootView method of ViewWillAppear:

self.rvBar.tintColor = [UIColor colorWithRed:59.0/255 green:115.0/255 blue:185.0/255 alpha:1]; 

Now, when I rotate the device and display the view through a popover, the popover is black. Do you know how to change the color of a popover to the same blue? I tried to do this in the willHide/ShowViewController methods in the delegate of a split view controller, but nothing works.

Now, the second part, when I turn back to the landscape, the line above is called again, but instead of displaying a blue bar, it is now gray! Has anyone seen splitview behave the way it used to, and if so, what needs to be done to fix this? Thanks in advance.

+4
source share
4 answers

I found a solution to this problem if anyone is still interested.

After some digging, I found that there is an Apple error that disables the modification of the tintColor UIToolBar property, and it gets stuck in any state. I had to send a message to the tintColor property to tell it that it is modifiable.

 extern id objc_msgSend (id, SEL, BOOL); objc_msgSend([(UINavigationController *)aViewController navigationBar], @selector(_setDisableCustomTint:), NO); /* Set the tintColor again */ [(UINavigationController *)aViewController navigationBar].tintColor = [UIColor colorWithRed:59.0/255 green:115.0/255 blue:185.0/255 alpha:1]; 

Obviously, this will not be acceptable if you plan to send your application to the Apple store, but for my purposes this did the trick. Hope this helps some of you guys out there ...

+1
source

I tried this in the base SplitViewController project (in the RootViewController):

 - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:59.0/255 green:115.0/255 blue:185.0/255 alpha:1]; } 

and it works great. When you say that a popover stays black, do you mean that the background header is black? (for me it's blue, and the popcord borders are black).

Perhaps the problem comes from other sources, how do you set your rvBar resource?

+2
source

You cannot change Popover tintColor , the property does not exist.

For more information about Popover, see the UIPopoverController Class Reference .

0
source

You can also change the navigation bar (Rootviewcontroller) through Interface Builder; just select the navigation bar from the list on the left and change the hue property by choosing from the rgb matrix or any other means that you have chosen.

0
source

Source: https://habr.com/ru/post/1342709/


All Articles