How to hide status bar in UIImagepickercontroller?

前端 未结 13 1965
眼角桃花
眼角桃花 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:55

    i think i solved this in a pretty simple way without subclassing and using plist. it only hides for UIImagePickerController.

    this example is for bringing up the photo gallary only, but i imagine you can apply it in the same way to anywhere with in uiimagepickercontroller

    - (void)showGallary
    {
      [CATransaction begin];
      [CATransaction setCompletionBlock:^{
          [[UIApplication sharedApplication] setStatusBarHidden:YES];
          [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
      }];
    
      imgPicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
    
      [CATransaction commit];
    }
    

提交回复
热议问题