在iOS上使用expo的react-native statusBar

Ayy*_*oub 4 android statusbar ios react-native expo

我试图改变statusBar我的react-native应用程序的颜色.

我正在使用expo他们的文档,他们只是指定添加: "androidStatusBar": { "backgroundColor": "#2E1D59" }

这与android有效,但他们没有提到如何使用iOS statusBar.

有人对此有所了解吗?

jev*_*lio 9

您无法更改iOS状态栏的颜色.

您可以使用React Native StatusBar模块隐藏它,或将文本颜色设置为浅色(白色)或深色(黑色).

您可以将组件放入应用程序的根组件中:

 <StatusBar barStyle="light-content" /> 
Run Code Online (Sandbox Code Playgroud)