【问题标题】:React native keyboardAvoidView covers half textInputReact native keyboardAvoidView 覆盖了一半 textInput
【发布时间】:2020-08-27 20:04:05
【问题描述】:

在三星 note 10 上观察到此错误,并非在所有设备上,但主要在三星上 键盘覆盖了一半的文本输入,我尝试了几个修复,但都没有工作。

<KeyboardAvoidingView
  style={{ flex: 1 }}
  behavior="padding"
>
  <GiftedChat
    // style={{ flex: 1 }}
    messages={this.state.messages}
    onSend={this.onSend.bind(this)}
    renderBubble={this.renderBubble}
    isAnimated
    renderMessageImage={(props) => (
      <this.renderMessageImage props={props} _this={this} />
    )}
    user={{
      _id: this.state.uid,
    }}
  />

            </View>
          </KeyboardAvoidingView >
        );

我也用过

{ Platform.OS === 'android' ? <KeyboardSpacer /> : null }

但它也不起作用

【问题讨论】:

    标签: react-native keyboard expo react-native-textinput


    【解决方案1】:

    我自己能够修复它,显然 android Q 现在添加了自动键盘支持,并且不需要额外的键盘助手。

    这是我更新的代码

     {Platform.OS === "android" && Platform.Version < 29 && (
          <KeyboardSpacer />
        )}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-13
      • 1970-01-01
      • 2017-01-09
      • 2023-03-23
      • 1970-01-01
      • 1970-01-01
      • 2017-10-06
      • 2020-05-28
      相关资源
      最近更新 更多