修改状态栏文字的颜色

来源:互联网 发布:传奇的dbc数据 编辑:程序博客网 时间:2024/06/04 17:56

这里写图片描述

#import "ViewController.h"#import "ThreeViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad {    [super viewDidLoad];//    [self setNeedsStatusBarAppearanceUpdate];}#pragma mark - 设置状态栏// 是否要隐藏状态栏 YES:隐藏 NO:显示- (BOOL)prefersStatusBarHidden{    return NO;}// 返回状态栏的样式// UIStatusBarStyleDefault:默认 -> 黑色// UIStatusBarStyleLightContent:亮的 -> 白色- (UIStatusBarStyle)preferredStatusBarStyle{    return UIStatusBarStyleLightContent;}- (IBAction)open:(id)sender {    ThreeViewController *threeVc = [[ThreeViewController alloc] init];    // 使用modal方式跳转到第三个控制器    // 状态栏是由ThreeViewController来管理的    [self presentViewController:threeVc animated:YES completion:nil];}
0 0
原创粉丝点击