简体   繁体   中英

UIImagePickerController hiding status bar iOS 8

I want the status bar hidden in my app. In my pList I have set: Status Bar is initially hidden - YES View controller-based status bar appearance - NO

This works fine until I present an UIImagePickerController. It wants to show the status bar. So in willShowViewController for the navigationController delegate I call [[UIApplication sharedApplication] setStatusBarHidden:YES]. This does in fact hide the status bar but there is a shifting like an animation in the navigationController. I've spent some time trying to stop this animation. Anyone have any ideas how to stop it? Thanks.

试试吧

 [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];

子类UIImagePickerController并定义prefersStatusBarHidden方法,如果要隐藏状态栏,则返回YES。

It turns out that this a bug in iOS 8. I filed a radar bug and Apple suggested I try the beta 8.3. With the beta I no longer see the animation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM