让状态栏上的文字变为变色,先在supporting files 里的plist文件中加一个ViewController-based status bar appearance 设为NO;
UIView * view1 = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 20)];
view1.backgroundColor = [UIColor redColor];
[self.view addSubview:view1];
[[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleLightContent];