iPad SplitView改变了主导航栏的颜色 [英] iPad SplitView changes main navigation bar color

查看:203
本文介绍了iPad SplitView改变了主导航栏的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

奇怪的问题:将我的应用程序旋转为纵向,选择工具栏项并显示uipopovercontroller后,如果我旋转回横向,右侧的UINavigationController(SplitView的objectAtIndex:0)会更改导航栏的颜色。我不知道为什么。我在Interface Builder中将它设置为barStyle = UIBarStyleBlackOpaque;

Weird problem: After rotating my app to portrait, picking the toolbar item and exposing the uipopovercontroller, if I rotate back to landscape, the UINavigationController on the right side (objectAtIndex:0 of the SplitView) changes the color of the navigation bar. I am not sure why. I have it set in Interface Builder to be barStyle = UIBarStyleBlackOpaque;

它在返回横向模式后变为银色。

It turns silver after it returns to landscape mode.

只有当我将其旋转为纵向,创建弹出窗口并在导航控制器中选择一些内容时才会发生这种情况,这会推动另一个tableViewController。即使在viewDidLoad方法中设置属性也不会做任何事情。

This only happens if I rotate it to portrait, create the popover, and select something in the navigation controller, which pushes another tableViewController. Even setting the properties in the viewDidLoad method does nothing.

任何人都有想法吗?

推荐答案

viewDidLoad只会在第一次显示视图时被调用(或者由于内存问题而被清除)。尝试在viewWillAppear中重新设置barStyle,甚至 - splitViewController:willShowViewController:invalidatingBarButtonItem:。

viewDidLoad will only get called the first time your view is displayed (or if it's cleared due to memory issues). Try re-setting the barStyle in your viewWillAppear, or even – splitViewController:willShowViewController:invalidatingBarButtonItem:.

这篇关于iPad SplitView改变了主导航栏的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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