【问题标题】:Video not covering the whole screen视频未覆盖整个屏幕
【发布时间】:2020-09-04 10:51:36
【问题描述】:

我希望我的视频覆盖整个屏幕,但它似乎只覆盖了一半的屏幕,如下所示

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

 <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}
              />

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

【问题讨论】:

  • 为什么将高度设置为宽度值? height: Dimensions.get('window').width,

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


【解决方案1】:

以某种方式给出高度解决了上述问题,如下所示:

  <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}
          
              />
 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-23
    • 2021-05-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多