Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 为什么可以';我不能更改状态栏的颜色吗?_React Native_Expo_Statusbar - Fatal编程技术网

React native 为什么可以';我不能更改状态栏的颜色吗?

React native 为什么可以';我不能更改状态栏的颜色吗?,react-native,expo,statusbar,React Native,Expo,Statusbar,这是我的代码: import React,{Component}来自'React'; 从“react native”导入{状态栏、平台、文本、样式表、视图}; 导出默认类选项卡可滚动示例扩展组件{ render(){ 返回( 像这样使用 <StatusBar barStyle = "light-content" hidden = {false} backgroundColor="white" translucent = {true} netwo

这是我的代码:

import React,{Component}来自'React';
从“react native”导入{状态栏、平台、文本、样式表、视图};
导出默认类选项卡可滚动示例扩展组件{
render(){
返回(
像这样使用

<StatusBar 
    barStyle = "light-content" 
    hidden = {false}
    backgroundColor="white"
    translucent = {true}
    networkActivityIndicatorVisible = {true}
    />


您可以通过正确的方式看到backgroundColor=“white”。可能还有另一个问题。您在哪台设备上进行测试?请尝试不使用半透明(我知道它应该可以正常工作,但您的android版本可能存在缺陷)。尝试使用rgb颜色(#ff0000)。请告诉我您的结果。

我以前指定的方法也尝试过,但不起作用。我以前指定的方法也尝试过,但不起作用。