美文网首页
修改导航栏与状态栏背景色的方法

修改导航栏与状态栏背景色的方法

作者: henu_Larva | 来源:发表于2017-10-31 13:11 被阅读18次
    //修改导航栏背景色
    self.navigationController.navigationBar.backgroundColor = [UIColor cyanColor];
    //修改状态栏背景色
    UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
    if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) {
        statusBar.backgroundColor = [UIColor cyanColor];
    }

相关文章

网友评论

      本文标题:修改导航栏与状态栏背景色的方法

      本文链接:https://www.haomeiwen.com/subject/wzhbpxtx.html