0

在三星 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

4

1 回答 1

0

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

这是我更新的代码

 {Platform.OS === "android" && Platform.Version < 29 && (
      <KeyboardSpacer />
    )}
于 2020-05-12T08:03:25.583 回答