简体   繁体   English

React native keyboardAvoidView 覆盖了一半 textInput

[英]React native keyboardAvoidView covers half textInput

This error is observed on Samsung note 10, Not on all devices, But mostly on Samsung The keyboard covers up half of the Textinput, I've tried a couple fixes, But none is working.在三星 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 >
        );

I also used我也用过

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

But it didn't work either但它也没有工作

聊天界面 React Native

I was a able to fix it myself, Apparently it seems android Q now added auto keyboard support and there are no need for extra keyboard helper.我能够自己修复它,显然 android Q 现在添加了自动键盘支持,并且不需要额外的键盘助手。

This is my updated code这是我更新的代码

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM