iPhone - Remove status bar programmatically

前端 未结 6 1756
刺人心
刺人心 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:50

    In this case,We are using 2 steps

    In first step: Add in info.plist: "View controller-based status bar appearance" with value "NO"

    In Second step: Use/call this code with delegate of UIImagePickerController

     - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
    {
         if([navigationController isKindOfClass:[UIImagePickerController class]])
             [[UIApplication sharedApplication] setStatusBarHidden:YES]; 
     }
    

提交回复
热议问题