【问题标题】:How Can I reslove this issue Keyboard overlapped when i entered text input如何解决此问题 输入文本输入时键盘重叠
【发布时间】:2017-09-04 06:40:10
【问题描述】:

我该如何解决这个问题。

键盘重叠如下图

代码在这里

<View style={styles.container}>
            <View style={styles.Subcontainer}>
      <ScrollView contentContainerStyle={styles.scrolViewFlex} ref='scrollView' automaticallyAdjustContentInsets={true} showsHorizontalScrollIndicator={true} showsVerticalScrollIndicator={true}>
            <View style={styles.logoView}>
              <Image source={require('@images/Icon_K.png')} style={styles.imageStyles} />
            </View>
        <View style={styles.textInputView}>
        <ActivityIndicator
                   animating = {this.state.animating}
                   color = '#494949'
                   size = "large"
                   style = {styles.activityIndicator}
                   /> 

        <View style={styles.namesContainer}>
           {/*<View style={styles.exploreContainerDirection}> */}
             <View style={styles.pincodeContainer}>
               <TextInput
                  underlineColorAndroid="transparent"
                  autoCapitalize="words"
                  style={[styles.firstnameTextInput,{borderColor:this.state.backgroundColor,color: this.state.color}]}
                  placeholder=" First Name"
                  placeholderTextColor="#494949"
                  returnKeyType='next'
                  onChangeText={this.handleChange.bind(this,'FirstName')}
                  value={this.state.updateAccountValues.FirstName}
                  onFocus={this.inputFocused.bind(this,'FirstName')}
                  onSubmitEditing={(event)=>{
                    this.refs.SecondInput.focus();
                    }}/>
             </View>
             <View style={styles.spaceview}/>
             <View style={styles.mobileNoContainer}>
               <TextInput
                  underlineColorAndroid="transparent"
                  autoCapitalize="words"
                  ref="SecondInput"
                  style={[styles.lastnametextInput,{borderColor:this.state.backgroundColor,color: this.state.color}]}
                  placeholder=" Last Name"
                  placeholderTextColor="#494949"
                  returnKeyType='next'
                  onChangeText={this.handleChange.bind(this,'LastName')}
                  onFocus={this.inputFocused.bind(this,'LastName')}
                  value={this.state.updateAccountValues.LastName}
                  onSubmitEditing={(event)=>{
                    this.refs.ThirdInput.focus();
                    }}/>
             </View>
          {/* </View>*/}
           </View>
  </ScrollView>
  </View>

  </View>

所以这是我的屏幕短,当我输入 textinput 键盘时,有时会出现在屏幕下方

所以,请检查一次并找到我们的问题

【问题讨论】:

  • 请提供一些代码
  • 添加了代码检查功能
  • 你到底想达到什么目的?
  • 我想要完全...当我在文本输入中输入数据时,整个设计在该屏幕中不可调整
  • 检查keyboardavoidingview api和keyboardavoidingscrollview库

标签: react-native react-native-android


【解决方案1】:

我跟着这个:设置 android:windowSoftInputMode="adjustPan" 在 MainfestFile.xml 文件中

React-native: How to control what keyboard pushes up

【讨论】:

    猜你喜欢
    • 2016-08-31
    • 1970-01-01
    • 1970-01-01
    • 2022-07-15
    • 1970-01-01
    • 1970-01-01
    • 2019-02-24
    • 2013-12-31
    • 1970-01-01
    相关资源
    最近更新 更多