React Native的KeyboardAvoidingView keyboardVerticalOffset与textinput上的下划线重叠

时间:2019-05-13 18:06:31

标签: android react-native

我正在使用keyboardVerticalOffset,以便在显示键盘时适当地向上移动内容。它工作正常,但是显示键盘时,下划线被遮盖了。

如果我增加keyboardVerticalOffset值,它只会在输入下方添加空白,而您仍然看不到下划线。

<KeyboardAvoidingView 
  style={{ 
    flex: 1, 
    flexDirection: 'column', 
    justifyContent: 'center', 
    backgroundColor: '#fff'
  }} 
  behavior="padding" 
  keyboardVerticalOffset={90}
  enabled>
   ScrollView 
     style={{backgroundColor: '#fff'}} 
     keyboardShouldPersistTaps='always'>
      <Content style={globalStyles.content} keyboardShouldPersistTaps='always'>
        <Form>
          {this.renderInspectionDetails()}
          {this.renderClientInformation()}
          {this.renderBuyersAgentDetails()}
          {this.renderSellersAgentDetails()}
          {this.renderNotes()}
        </Form>
      </Content>
    </ScrollView>
</KeyboardAvoidingView>

下图显示了重点突出的文本输入。

enter image description here

0 个答案:

没有答案