How to hide status bar in UIImagepickercontroller?

前端 未结 13 1921
眼角桃花
眼角桃花 2020-11-30 02:55

I am new to iOS development. I am trying to hide status bar in UIImagePickerController. Whenever I click on \"Take photo\", status bar appears. It doesn\'t hide

13条回答
  •  执笔经年
    2020-11-30 03:41

    If you want to disable the status bar from plist, try this:

    1. Status bar is initially hidden : YES
    2. View controller-based status bar appearance : NO

    this is necessary for iOS 7, works for me. I do not know if there are some other techniques for doing this in iOS7. Set these two tags in your info.plist.

    Everytime your viewcontroller appears, in viewDidLoad or when image picker controller finishes , use this:

     - (void) imagePickerController:(UIImagePickerController *)picker1 didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo
    {
       [[UIApplication sharedApplication] setStatusBarHidden:YES];
     .
     .
     .
     .
     }
    

提交回复
热议问题