【问题标题】:Keyboard alignment issue with multiline text input多行文本输入的键盘对齐问题
【发布时间】:2019-02-24 07:21:07
【问题描述】:

我也使用过 KeyboardAvoidingView,如果它只有单行而不是多行,则可以正确对齐键盘。

<KeyboardAvoidingView behavior="position">
    <TextInput
     placeholder='input 1'
     placeholderTextColor='gray'
     multiline={true}
     onContentSizeChange={(e) => console.log(e.nativeEvent.contentSize)}
     value='text 1'
    />
    <TextInput
     placeholder='input 2'
     placeholderTextColor='gray'
     multiline={true}
     onContentSizeChange={(e) => console.log(e.nativeEvent.contentSize)}
     value='text 2'
    />
</KeyboardAvoidingView>

有没有办法在 react native 中将键盘与多行 textInputs 正确对齐?

【问题讨论】:

    标签: javascript ios typescript react-native react-native-textinput


    【解决方案1】:

    它对我来说很完美,可能是因为版本不同,如果那个东西仍然不适合你,那么你可以使用条件对齐方式,因为它被按下屏幕应该滚动,或者你可以使用变换它与 z-index

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-20
      • 2021-06-26
      • 1970-01-01
      • 2013-12-31
      • 1970-01-01
      • 2012-04-13
      相关资源
      最近更新 更多