2017-07-08 133 views
0

我有这样的代码:为什么状态栏颜色不变?

import React from 'react'; 
import { View, StatusBar } from 'react-native'; 

export default class App extends React.Component { 
    render() { 
    return (
     <View> 
     <StatusBar 
      backgroundColor="blue" 
      barStyle="light-content" 
     /> 
     </View> 
    ); 
    } 
} 

和我在Android上的6 EXPO应用程序运行它 - MIUI 8.5。我的问题是,为什么状态栏仍然是白色的。不是蓝色?没有什么改变。我只有空白的白色屏幕(因为MiUI中的状态栏文本也是白色的)。

+1

你可以尝试使用“#00F”而不是“蓝色”。 –

+0

@SagarKhatri'backgroundColor =“#FFB515”'也没有改变任何东西,兄弟 –

+1

https://stackoverflow.com/questions/43917663/statusbar-color-in-react-native/43920029#43920029 –

回答

0

我关闭了世博的应用程序,并再次启动它。它的工作原理。我认为问题在于EXPO应用程序。