iPhone - Remove status bar programmatically

前端 未结 6 1769
刺人心
刺人心 2021-01-02 09:17

I have made an app that implements the iPhone\'s camera. When the user finishes picking their image, the status bar reappears! How would I make sure that the status bar sta

6条回答
  •  心在旅途
    2021-01-02 09:42

    There seems to be a bug in the dismiss mechanism of UIViewController associated with UIImagePicker, with a sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum.

    The moment of the call to dismissModalViewController (plus the method with completion:) the UIApplication's status bar hidden property instantly changes from YES to NO, and it is drawn at the moment of stepping over dismiss...

    This is only really obvious for apps that use a full-screen view. My current app project does, plus I control the frame of the view controller's view before presenting, so the UIImagePicker is NOT full screen. This made the bug VERY obvious. I spent 4-5 hours determining the cause, and this was the final certain conclusion, and the bug does NOT occur for sourceType Camera nor PhotoLibrary.

    So if you want a perfectly full-screen app and want to present a bug-free UIImagePicker, avoid UIImagePickerControllerSourceTypeSavedPhotosAlbum

提交回复
热议问题