将本机KeyboardAvoidingView与页脚粘贴在一起

时间:2017-07-15 14:37:05

标签: react-native keyboard

我在屏幕底部使用反应原生的KeyboardAvoidingView输入justifyContent:'flex-end')。键盘仍然隐藏输入。

frame iphone 6

 <View
    style={{
      backgroundColor: AppConst.Colors.rowBg,
      flex: 1,
      paddingLeft: 20,
      paddingRight: 20,
      justifyContent: 'flex-end',
    }}
  >
    <KeyboardAvoidingView behavior="padding">
      <Text style={{ color: AppConst.Colors.blackApp, fontSize: 18 }}>
        A description goes here
      </Text>
      <View
        style={{
          height: 50,
          width: width - 40,
          justifyContent: 'center',
          paddingLeft: 20,
          backgroundColor: '#FFF',
        }}
      >
        <TextInput
          style={{ color: AppConst.Colors.blackApp, backgroundColor: '#FFF', height: 50 }}
          onChangeText={this.onChangeFriendCode}
          placeholderTextColor={AppConst.Colors.grayApp}
          value={this.state.token}
          placeholder={this.props.store.translate('ENTER_CODE')}
          tintColor={AppConst.Colors.mainApp}
          maxLength={6}
          autoCorrect={false}
        />
      </View>
      <Butto
        captionStyle={{
          color: AppConst.Colors.mainApp,
          textAlign: 'center',
        }}
        caption={'A button here'}
      />
    </KeyboardAvoidingView>
  </View>

0 个答案:

没有答案