在本机旋转屏幕时,按钮宽度无法达到设备宽度

时间:2018-12-13 06:41:20

标签: react-native

旋转屏幕时,按钮宽度根据屏幕宽度而失败。以纵向或横向模式刷新没有问题,但是旋转屏幕宽度失败时

  < KeyboardAvoidingView style = { Styles.viewPort } >
  <ImageBackground style={Styles.wallpaper} source={/*src*/}>
  <ScrollView style={Styles.regContainer}>
    <View style={Styles.reInputContainer}>
      <View style={Styles.reInputContainer}>
        <TouchableOpacity
          style={Styles.saveButton}
          onPress={this.nexView}>
          <Text style={Styles.loginText}>Next</Text>
        </TouchableOpacity>
      </View>
    </View>
  </ScrollView>
</ImageBackground>

样式:

regContainer: {
flex: 3,
// flexDirection:'column-reverse',
//marginTop: 50,
backgroundColor: 'transparent'
},
reInputContainer: {
// marginTop:50,
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
saveButton: {
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#f16e0d',
height: 40,
borderRadius: 20,
width: DEVICE_WIDTH - 40,
margin: 20,
zIndex: 100,
},

0 个答案:

没有答案