iPad - Popover框架颜色 [英] iPad - Popover frame color

查看:111
本文介绍了iPad - Popover框架颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个我正在处理的分割视图应用程序并遇到了一个奇怪的UI错误。这是我最好的解释方法。如果我以横向模式加载应用程序,根控制器的顶部导航栏是正确的颜色。我在rootView的ViewWillAppear方法中执行此操作:

So I have a split view application I am working on and have encountered a strange UI bug. Here goes my best attempt to explain it. If I load the app in landscape mode, the top navigation bar of the root controller is the proper color. I am doing this in rootView's ViewWillAppear method:

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

现在当我旋转设备并通过弹出窗口显示视图时,弹出框是黑色的。你知道如何将popover的颜色改为同样的蓝色吗?我尝试在拆分视图控制器委托中的 willHide / ShowViewController 方法中执行此操作,但似乎没有任何工作。

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

现在是第二部分,当我旋转回横向时,再次调用上面的一行,但不是显示蓝色条,它现在是灰色的!有没有人见过splitview之前的行为,如果有的话,需要做些什么来解决它?在此先感谢。

Now part two, when I rotate back to landscape, the line above is called again, but instead of displaying the blue bar, it's now grey! Has anyone seen a splitview behave like this before, and if so, what needs to be done to fix it?? Thanks in advance.

推荐答案

如果有人还在想,我已经发现了这个问题的解决方案。

I have discovered the solution to this problem if anyone is still wondering.

在做了一些挖掘之后,我发现有一个Apple bug会禁用UIToolBar tintColor属性的修改,并且它会陷入任何状态。我不得不向tintColor发送消息属性,以告诉它它是可修改的。

After doing some digging, I discovered that there is an Apple bug that disables the modification of the UIToolBar tintColor property, and it gets stuck in whatever state it's in. I had to send a message to the tintColor property in order 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];

如果您打算将申请提交到Apple商店,显然这是不可接受的,但是我的目的就是这个伎俩。希望这能帮助你们中的一些人...

Obviously this won't be acceptable if you plan on submitting your application to the Apple store, but for my purposes this did the trick. Hope this helps some of you guys out there...

这篇关于iPad - Popover框架颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆