How to add icon (image, logo..) to the status bar

前端 未结 3 1151
一生所求
一生所求 2021-02-19 01:52

I have noticed that there is no props for the StatusBar component (React Native) to include an icon or logo of any kind as in this documentation: https://facebook.github.io/rea

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-19 02:23

    You can't change the status bar. Apple only allows you to change the appearance of the status bar. For the ios app maybe changing the appearance globally works for you.

    Open the .xcproj file generated by ReactNative and:

    1. In your Info.plist you need to set "View controller-based status bar appearance" to a boolean value.
    2. set it to NO set the style in AppDelegate adding this code on the didFinishLaunchingWithOptions function: UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)

提交回复
热议问题