Since Applying the backgroundColor props to StatusBar component doesn't get applied On IOS. I need to set the background colour of SafeAreaView to get the effect i want, it works fine but on iPhone X it will have that same colour at the bottom of the screen. How can I solve this issue?
相关问题
- Core Data lightweight migration crashes after App
- React Native Inline style for multiple Text in sin
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Why do we have to call `.done()` at the end of a p
- Swift - hide pickerView after value selected
- How can I vertically align my status bar item text
- How do you detect key up / key down events from a
React-Native does not support background color change of StatusBar on iOS platform but on Android platform, it's ok (https://facebook.github.io/react-native/docs/statusbar#backgroundcolor). I wrote a work around for your problem. You can use it safely
For SafeAreaView:
Support for iPhone X
In addition to @sdkcy's answer, for iPhone X the STATUS_BAR_HEIGHT can´t be 20.
I solved it by installing the following library:
https://www.npmjs.com/package/react-native-status-bar-height
Install
Import
And update the STATUS_BAR_HEIGHT like this:
Finally, I also changed the height for Android to 0, because it was affecting the NavigationBar's height, but if it is working well for you, you can keep it the same.
Hope this helps.