我在我的本机项目中使用react-native-video组件。 我需要更改状态栏颜色。在不调用video组件的情况下,我可以更改状态栏的颜色,但是当我调用react-native-video的Video组件时,状态栏的颜色固定为白色。 这是一些代码示例
<View style={{ flex: 1,backgroundColor: "black" }}>
<StatusBar
hidden={this.state.orientation === "landscape" ? true : false}
backgroundColor = "#00BCD4"
/>
<View style={[VideoPlayerStyles.videoWrapper, screenMode]}>
<TouchableOpacity activeOpacity={1} onPress={this.showControls}>
<Video
source={{
uri:
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4"
}} // Can be a URL or a local file.
ref={ref => {
this.player = ref;
}} // Store reference
onBuffer={this.onBuffer} // Callback when remote video is buffering
onError={this.videoError} // Callback when video cannot be loaded
style={VideoPlayerStyles.videoStyle}
resizeMode="contain"
paused={this.state.paused}
repeat
// controls
fullscreen
fullscreenOrientation={"landscape"}
fullscreenAutorotate={false}
/>
</TouchableOpacity>
</View>
</View>