How to Change the color of status bar

后端 未结 5 2117
庸人自扰
庸人自扰 2021-01-04 04:31

How can we change the color of the status bar? I know we can change the style by

[application setStatusBarStyle:UIStatusBarStyleBlackOpaque];
         


        
5条回答
  •  猫巷女王i
    2021-01-04 04:55

    Just for information, for those who don't want to change view frames, setting window background will also work.

    I wrote this in AppDelegate.

    self.window.backgroundColor = [UIColor colorWithRed:0.78f green:0.13f blue:0.11f alpha:1];
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];
    

提交回复
热议问题