viewDidLoad に次の行を追加します。
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
新しいメソッドを追加します
- (BOOL)prefersStatusBarHidden {
return YES;
}
info.plist ファイルも変更します
View controller-based status bar appearance" = NO
また、iPhone 6 および 6 Plus の条件も追加します。iPhone 6 および 6 Plus のメソッドは次のとおりです。
/*=====================================================================================================================
Checks if the device has 4.7 inch screen such as iPhone6 generation
=====================================================================================================================*/
+(BOOL) ISiPhone6
{
BOOL isIpad = ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad);
CGRect screenRect = [[UIScreen mainScreen] bounds];
// we need to check the maximum of width and height because some screens (the camera view while scanning) we can
// rotate to portrait or landscape and in the case the screen height and width flip
return (!isIpad && MAX(screenRect.size.height,screenRect.size.width) == 667);
}
/*=====================================================================================================================
Checks if the device has 5.5 inch screen such as iPhone6 plus
=====================================================================================================================*/
+(BOOL) ISiPhone6Plus
{
BOOL isIpad = ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad);
CGRect screenRect = [[UIScreen mainScreen] bounds];
// we need to check the maximum of width and height because some screens (the camera view while scanning) we can
// rotate to portrait or landscape and in the case the screen height and width flip
return (!isIpad && MAX(screenRect.size.height,screenRect.size.width) == 736);
}
それは私のために働く。