修改ios状态栏和导航颜色

1、在info.plist中添加一个字段:view controller -base status bar 设置为NO

2、

UIView *statusBarView=[[UIViewalloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 20)];

    statusBarView.backgroundColor = color_31343f;;

    [self.viewaddSubview:statusBarView];

    [UIApplicationsharedApplication].statusBarStyle = UIStatusBarStyleLightContent;

    self.navBar.barTintColor = color_31343f;

猜你喜欢

转载自wenxin2009.iteye.com/blog/2331354