默認(rèn)狀態(tài)下
狀態(tài)欄的內(nèi)容為黑色废赞,背景色為白色
想要改變狀態(tài)欄的字體,電源叮姑,運營商等內(nèi)容的顏色需要
下面代碼是將狀態(tài)欄內(nèi)容改為白色
在info.plist 文件中更改添加? View controller-based status bar appearance? == NO
然后添加代碼唉地,將[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
想要改變狀態(tài)欄背景顏色:
下面代碼是將背景色改為黑色
CGFloatstatwidth = [[UIApplicationsharedApplication]statusBarFrame].size.width;
CGFloatstatheight = [[UIApplicationsharedApplication]statusBarFrame].size.height;
UIView*statusBarView=[[UIViewalloc]initWithFrame:CGRectMake(0,0, statwidth, statheight)];
statusBarView.backgroundColor=[UIColorblackColor];