首页 > 代码库 > iOS导航栏状态栏相关

iOS导航栏状态栏相关

状态栏设置颜色没用:

  1. 在UIViewController里的viewWillApper或viewDidAppear里面加入[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]
  2. 去info.plist文件里面设置View controller–based status bar appearance 为NO

技术分享

  1. [[UINavigationBar appearance]  setBackgroundImage:[[UIImage alloc] init] forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
  2. [[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];

或者 

    self.navigationController.navigationBar.clipsToBounds = YES;

 
 

iOS导航栏状态栏相关