本文介绍了在iOS上显示键盘后如何固定标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在iOS设备上打开键盘后,固定标题就会滚动.打开键盘后,是否有固定的接头连接器?我不想让标题随内容滚动.
The fixed header is scrolling after keyboard is open on iOS device. Is there any possibility to have fixed header after keyboard is open? I do not want to have header scrolling with the content.
这里说明类似的问题: https://medium.com/@im_rahul/safari-and-position-固定-978122be5f29
Here is explained similar problem:https://medium.com/@im_rahul/safari-and-position-fixed-978122be5f29
我正在使用Cordova在React项目中遇到问题.
I am facing the problem in the React project using Cordova.
非常感谢您的帮助.
推荐答案
使用"react-native"中的keyboardAvoidingView
文档
import {
KeyboardAvoidingView
} from 'react-native';
<KeyboardAvoidingView behavior="padding" style={styles.container}>
<View style={styles.inputContainer}>
<TextInput
returnKeyType="next"
placeholder="Mobile No."
placeholderTextColor="powderblue"
keyboardType="number-pad"
onSubmitEditing={() => this.passwordInput.focus()}
style={styles.input}
onChangeText={(value) => this.setState({mobileno:value})}
value={this.state.mobileno}
/>
<TextInput
returnKeyType="go"
placeholder="Password"
placeholderTextColor="powderblue"
style={styles.input}
secureTextEntry
ref={input => (this.passwordInput = input)}
onChangeText={(value) => this.setState({pssd:value})}
value={this.state.pssd}
/>
</View>
</KeyboardAvoidingView>
这篇关于在iOS上显示键盘后如何固定标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!