状态栏仍然显示 [英] Status Bar Still Showing
问题描述
我真的很沮丧!!
我已经尝试过各种生活可能性摆脱我应用程序顶部的UIStatusBar ......
我试过:
-
在IB中将状态栏设置为无 / p>
-
运行
[[UIApplication的sharedApplication] setStatusBarHidden:YES];
上的应用程序启动并在每个场景 -
转到.plist并更改启动时隐藏状态栏的值:是
-
在目标主页上设置相同的值
-
设置
- (BOOL)prefersStatusBarHidden
{
返回YES;应用委托中的
}
字面意思,这一切都不起作用..它仍然显示在我的所有观点上,这是令人沮丧的
再次感谢:)
旁注:我在xcode 5,开发者测试版iOS 7 beta 6,但这也发生在我的旧ios6和xcode 4应用上
请尝试此
// viewDidLoad中
如果([自respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)] ){
// iOS 7
[self prefersStatusBarHidden];
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
} else {
// iOS 6
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
}
//添加此方法
- (BOOL)prefersStatusBarHidden
{
return YES;
}
此代码取自此链接
I am getting REALLY frustrated!!
I have tried every living possibility to get rid of the UIStatusBar at the top of my app...
I have tried:
Setting Status Bar to "None" in IB
Running
[[UIApplication sharedApplication] setStatusBarHidden:YES];
on application launch AND in each scene.Going to the .plist and changing the value for Status Bar Hidden at Startup: YES
Setting that same value on the home page for the target
Setting
- (BOOL)prefersStatusBarHidden { return YES; }
in the app delegate
Literally none of this works... It still shows up on all of my views, and it is SUPER frustrating
Thanks again :)
Side note: I'm in xcode 5, developer beta iOS 7 beta 6, but this also happens on my old ios6 and xcode 4 apps
Please try this
//viewDidload
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
// iOS 7
[self prefersStatusBarHidden];
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
} else {
// iOS 6
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
}
// Add this Method
- (BOOL)prefersStatusBarHidden
{
return YES;
}
This code has been taken from this link
这篇关于状态栏仍然显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!