[英]ios 6 navigation bar and status bar overlapped
The problem is like this: My status bar is intially hidden. 问题是这样的:我的状态栏最初是隐藏的。 I have a tab bar controller and it has a navigation controller in each of its tabs. 我有一个标签栏控制器,并且在每个标签中都有一个导航控制器。 Screen shot is like: 屏幕截图如下:
Later I clicked on a button on the navigation controller's view, I would like to reveal the status bar, but it ends like this: 后来我单击了导航控制器视图上的一个按钮,我想显示状态栏,但是它的结束是这样的:
the navigation bar overlaps the status bar. 导航栏与状态栏重叠。 I have to perform some actions like tapping another tab to make the navigation bar go down. 我必须执行一些操作,例如点击另一个选项卡以使导航栏下降。
I tried to set status bar to UIStatusBarStyleBlackOpaque and it worked fine. 我试图将状态栏设置为UIStatusBarStyleBlackOpaque,并且工作正常。 But if I press the "home" button on iphone to turn the app to bacground and the switch back to active, the problem occurs again if I clicked on the button. 但是,如果我按iphone上的“主页”按钮将应用程序关闭,然后切换回活动状态,则单击该按钮会再次出现问题。
Your status bar style is UIStatusBarStyleBlackTranslucent
. 您的状态栏样式为UIStatusBarStyleBlackTranslucent
。 You should set it to either UIStatusBarStyleDefault
or UIStatusBarStyleBlackOpaque
for the desired effect. 您应该将其UIStatusBarStyleBlackOpaque
为UIStatusBarStyleDefault
或UIStatusBarStyleBlackOpaque
以获得所需的效果。
Translucent status bars overlap the full screen views, while opaque ones push those views down. 半透明的状态栏与全屏视图重叠,而不透明的状态栏则将这些视图向下推。
click on button, do following things: 单击按钮,执行以下操作:
self.wantsFullScreenLayout = NO;
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque]; //or UIStatusBarStyleDefault
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.