现在的位置: 首页 > 综合 > 正文

IOS7开发~解决UIImagePickerController出现时候显示StatusBar

2018年01月23日 ⁄ 综合 ⁄ 共 574字 ⁄ 字号 评论关闭

1、首先配置项目plist

(1)添加 View controller-based status bar appearance,并设置为NO

(2)添加 Status bar is initially hidden,并设置为YES

2、在UIImagePickerController使用的 ViewController中添加  navigationController  willShowViewController  animated:方法

  1. UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init];  
  2. imagePicker.delegate = self;  
  3.   
  4. - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated  
  5. {  
  6.     [[UIApplication sharedApplication] setStatusBarHidden:YES];  

抱歉!评论已关闭.