setNeedsStatusBarAppearanceUpdate unrecognized selector

后端 未结 2 1478
面向向阳花
面向向阳花 2020-12-11 08:35

I had an issue with my iOS phonegap app having the status bar overlap the webview in iOS 7. I found this answer which fixed the problem, but the second step, calling

<
相关标签:
2条回答
  • 2020-12-11 09:03

    In the future, if you ever need to use something from iOS 7, such as setNeedsStatusBarAppearanceUpdate and you need to still support earlier iOS versions, you can first check if the selector is supported:

    if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)])
    {
        [self setNeedsStatusBarAppearanceUpdate];
    }
    
    0 讨论(0)
  • 2020-12-11 09:16

    Turns out it is unnecessary to add [self setNeedsStatusBarAppearanceUpdate]; and the app ran fine in iOS 6 and iOS 7.

    0 讨论(0)
提交回复
热议问题