Set the status bar to black colour

后端 未结 5 721
盖世英雄少女心
盖世英雄少女心 2020-12-10 09:22

I want to set the colour of the status bar (The small strip on top where the clock and battery is displayed) to black background with white text. How can I do

5条回答
  •  猫巷女王i
    2020-12-10 09:49

    You can make the text white by calling:

    UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)
    

    The status bar has a transparent background. There is no way of changing that. You can pin a view underneath it to act as a background.

提交回复
热议问题