视频无法覆盖整个屏幕

时间:2020-09-04 10:51:36

标签: reactjs react-native react-native-android react-native-ios react-native-video

我希望我的视频能覆盖整个屏幕,但似乎只能覆盖一半的屏幕,如下所示 enter image description here

我对视频组件的样式设置如下:

 <Video
                source={{uri: this.state.video}}
                style={{
                  position: 'absolute',
                  top: 0,
                  left: 0,
                  alignItems: 'stretch',
                  bottom: 0,
                  right: 0,
                  height: Dimensions.get('window').width,
                }}
                resizeMode="cover"
                repeat={true}
              />

谁能告诉我如何实现这种行为,我在哪里出错? 任何帮助都会有用。

1 个答案:

答案 0 :(得分:0)

不知何故,已经解决了以下提到的问题:

  <Video
                source={{uri: this.state.video}}
                style={{
                  position: 'absolute',
                  top: 0,
                  left: 0,
                  alignItems: 'stretch',
                  bottom: 0,
                  right: 0,
                  height: "90%",
                }}
                resizeMode="cover"
                repeat={true}
          
              />