【问题标题】:fix error hidding status bar on ios 7修复 ios 7 上隐藏状态栏的错误
【发布时间】:2013-12-19 09:03:43
【问题描述】:

![ios 71上的错误隐藏状态栏@

我在使用 ios 7 时遇到问题。
1. ios7 从 xcode 4.6 构建时,我想要隐藏状态栏。
2.App当前运行在iOS 7设备上,但是相机胶卷状态栏显示的是旧版本的ios。

你能帮我解决上面的问题吗?
非常感谢。

【问题讨论】:

  • 我认为您可能需要提供更多信息才能获得任何答案。我真的不清楚你在问什么。

标签: ios7 uiimagepickercontroller statusbar


【解决方案1】:

将以下代码添加到您的视图控制器:

 if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
    // iOS 7
    [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
 } else {
     // iOS 6
     [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
 }

 - (BOOL)prefersStatusBarHidden {
     return YES;
  }

iOS 7

请将此添加到您的 info.plist 文件中,它会有所作为 :)

UIStatusBarHidden UIViewControllerBasedStatusBarAppearance 

希望它会有所帮助。

编码愉快...:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-04-04
    • 1970-01-01
    • 2013-09-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-18
    • 1970-01-01
    相关资源
    最近更新 更多