LoginSignup
5
5

More than 5 years have passed since last update.

statubarを20px下げてstatusバーを表示

Last updated at Posted at 2014-07-22

1.
plistで
View controller-based status bar appearance

を NOにする

Status bar style

を Opaque black style にする

2.
下記コードを実装

//iOS7以上の場合は、ステータスバー20px分下げる
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
    CGRect viewBounds = [self.window bounds];
    viewBounds.origin.y = 20;
    viewBounds.size.height = viewBounds.size.height - 20;
    self.window.frame = viewBounds;
}
[UINavigationBar appearance].tintColor = [UIColor blackColor];
[UINavigationBar appearance].titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor blackColor]};


[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
5
5
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5