상태바(Status Bar) 숨기기
최고관리자
2019.10.01 13:06
2,087
0
본문
Write example for Objective-C (The same code for SWIFT already wrote by @dennykim)
Create property for BOOL
@property (nonatomic,assign) BOOL statusBarHidden;
Set in info.plist View controller-based status bar appearance == YES
Go to ViewController and write the next code:
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
self.statusBarHidden = TRUE;
[self setNeedsStatusBarAppearanceUpdate];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
self.statusBarHidden = FALSE;
[self setNeedsStatusBarAppearanceUpdate];
}
- (BOOL)prefersStatusBarHidden {
return self.statusBarHidden;
}
==============================================
- (BOOL)prefersStatusBarHidden {
return YES;
}
댓글목록 0