1. 程式人生 > >如何將IOS中Status Bar(狀態列)設定成黑底白字

如何將IOS中Status Bar(狀態列)設定成黑底白字

一般情況下預設的是白底黑字,那麼如何設定呢?首先在工程中選擇targets然後選擇info欄,然後在properties中新增View controller-based status bar appearance(新增的方法就是點中properties中任何一欄,然後會出現一個+ -號,點一下+,然後將名字更改為這個就可以了),然後設定其值為NO,最後在appDelegate中輸入如下程式碼
[UIApplication sharedApplication].statusBarStyle=UIStatusBarStyleLightContent;
self.window.backgroundColor=[UIColor blackColor];