【问题标题】:React Native TextInput on iOS hides keyboard after one keystroke一键后iOS上的React Native TextInput隐藏键盘
【发布时间】:2020-05-28 05:02:24
【问题描述】:

从“反应”导入反应; 进口 { 文本输入, KeyboardAvoidingView, 样式表 } 来自 'react-native';

从'../constants/Colors'导入颜色;

const QaTextInput = ({ style, minWidth, maxWidth, placeholder }) => { 常量输入 = { 身高:35, 最小宽度:最小宽度, 最大宽度:最大宽度, 边框宽度:1, 边框颜色:颜色.输入, 背景颜色:颜色.输入 };

return (
    <KeyboardAvoidingView
        behavior="position"
        keyboardVerticalOffset="100"
        enabled>
        <TextInput
            placeholder={placeholder}
            autoFocus={true}
            showSoftInputOnFocus={true}
            style={input}
        />
    </KeyboardAvoidingView>
);

};

导出默认QaTextInput;

【问题讨论】:

    标签: ios react-native keyboard textinput


    【解决方案1】:

    这就是我使用该组件的方式。其中一个父节点是一个文本节点。将其更改为 View 解决了它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-13
      • 1970-01-01
      • 1970-01-01
      • 2017-07-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-15
      相关资源
      最近更新 更多