Max*_*yuk 5 android statusbar react-native expo create-react-native-app
如何StatusBar在react-native不编辑Android特定文件的情况下更改组件的背景颜色?
Docs 说,我可以使用backgroundColor财产.但它失败了.barStyle属性,setBarStyle&& setBackgroundColor静态方法也不能正常工作.
只有hidden财产有效.
我正在使用create-react-native-app,用Expo建造.
在Expo App中,您需要app.json在项目根目录中进行编辑,如下所示:
{
"expo": {
"sdkVersion": "16.0.0",
"androidStatusBar": {
"barStyle": "dark-content",
"backgroundColor": "#0A48A5"
}
}
}
Run Code Online (Sandbox Code Playgroud)
请参阅Expo文档:https: //docs.expo.io/versions/v16.0.0/guides/configuration.html
您可以使用
<StatusBar
backgroundColor="blue"
barStyle="light-content"
/>
Run Code Online (Sandbox Code Playgroud)
您可以在此处查看文档。
| 归档时间: |
|
| 查看次数: |
8494 次 |
| 最近记录: |