彻底解决iOS7状态栏隐藏的问题(以及setStatusBarHidden:YES不起作用问题)

时间:2025-01-28 22:17:56
@interface IFImagePickerControllerEx :UIImagePickerController
- (void)viewDidDisappear:(BOOL)animated;
- (void)viewDidAppear:(BOOL)animated;
- (void)viewWillDisappear:(BOOL)animated;
@end

@implementation IFImagePickerControllerE x
- (void)viewDidAppear:(BOOL)animated
{
    [superviewDidAppear:animated];
    [[UIApplicationsharedApplication]setStatusBarStyle:UIStatusBarStyleDefault];
}
- (void)viewWillDisappear:(BOOL)animated
{
    [superviewWillDisappear:animated];
    [[UIApplicationsharedApplication] setStatusBarHidden:YES withAnimation:NO];
}
- (void)viewDidDisappear:(BOOL)animated
{
    [superviewDidDisappear:animated];
    [[UIApplicationsharedApplication] setStatusBarHidden:YES withAnimation:NO];
}