iOS Dev (53) 修復UIImagePickerController偷換StatusBar顏色的問題 – iPhone手機開發技術文章 iPhone軟體開發教學課程

iOS Dev (53) 修復UIImagePickerController偷換StatusBar顏色的問題

  •  
  • - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
    {   
        // bug fixes: UIIMagePickerController使用中偷換StatusBar顏色的問題
        if ([navigationController isKindOfClass:[UIImagePickerController class]] &&
            ((UIImagePickerController *)navigationController).sourceType ==     UIImagePickerControllerSourceTypePhotoLibrary) {
            [[UIApplication sharedApplication] setStatusBarHidden:NO];
            [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO];
        }
    }
    

    Reference

    • https://my.oschina.net/megan/blog/167500
    • https://www.vinqon.com/codeblog/?detail/11109

You May Also Like