iOS状态栏重叠问题以及如何隐藏状态栏
生活随笔
收集整理的這篇文章主要介紹了
iOS状态栏重叠问题以及如何隐藏状态栏
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、狀態欄重疊問題
1、在info.plist中新增?View controller-based status bar appearance 項并且將Value設置成 NO 這樣狀態欄就變成白字了。
2、在AppDelegate.m中加入下面的代碼,判斷系統版本然后將window的frame下拉20個像素
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20); UIApplication *myApp = [UIApplication sharedApplication]; [myApp setStatusBarStyle: UIStatusBarStyleLightContent]; }
二、隱藏狀態欄
??
找到Info.plist文件
不但要在Info.plist中增加 Status bar is initially hidden一行,選擇為 YES,
還需增加 View controller-based status bar appearance 一行,選擇為 NO。
總結
以上是生活随笔為你收集整理的iOS状态栏重叠问题以及如何隐藏状态栏的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android-MPAndroidCha
- 下一篇: abb机器人示教器io信号关联_ABB机