简体   繁体   中英

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.

<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.

This is my updated code

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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