We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextInput是一个允许用户在应用中通过键盘输入文本的基本组件。在TextInput获得焦点时,键盘会弹出。
TextInput
声明变量:
var dismissKeyboard = require('dismissKeyboard');
在点击事件中调用:
dismissKeyboard();
ScrollView控件中有个属性,keyboardShouldPersistTaps。
先看下官网的讲解:
版本0.43之前:bool(false, true)
版本0.43之后: enum('always', 'never', 'handled', false, true)
Keyboard组件可以监听原生键盘事件以做出相应回应,比如收回键盘。
我们看下官方的示例:
this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);
static addListener(nativeEvent, jsFunction)
addListener用于注册一个JavaScript函数来监听处理原生键盘通知事件。此方法会返回监听函数的引用。
@param {string} nativeEvent nativeEvent参数用来指明要监听的事件,具体有以下几种:
keyboardWillShow // 键盘弹出前 keyboardDidShow // 键盘弹出后 keyboardWillHide // 键盘关闭前 keyboardDidHide // 键盘关闭前 keyboardWillChangeFrame // 键盘改变前 keyboardDidChangeFrame // 键盘改变后
注意:如果你把android:windowSoftInputMode设置为adjustResize或是adjustNothing,则在Android上只有keyboardDidShow和keyboardDidHide事件有效。
@param {function} jsFunction 事件触发时调用的js函数。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
键盘弹出
1.TextInput
TextInput是一个允许用户在应用中通过键盘输入文本的基本组件。在
TextInput
获得焦点时,键盘会弹出。键盘关闭
1.调用键盘关闭API
声明变量:
在点击事件中调用:
2.scrollview中操作键盘
ScrollView控件中有个属性,keyboardShouldPersistTaps。
先看下官网的讲解:
版本0.43之前:bool(false, true)
版本0.43之后:
enum('always', 'never', 'handled', false, true)
键盘监听
1.Keyboard
Keyboard组件可以监听原生键盘事件以做出相应回应,比如收回键盘。
我们看下官方的示例:
static addListener(nativeEvent, jsFunction)
addListener用于注册一个JavaScript函数来监听处理原生键盘通知事件。此方法会返回监听函数的引用。
@param {string} nativeEvent nativeEvent参数用来指明要监听的事件,具体有以下几种:
keyboardWillShow // 键盘弹出前
keyboardDidShow // 键盘弹出后
keyboardWillHide // 键盘关闭前
keyboardDidHide // 键盘关闭前
keyboardWillChangeFrame // 键盘改变前
keyboardDidChangeFrame // 键盘改变后
注意:如果你把android:windowSoftInputMode设置为adjustResize或是adjustNothing,则在Android上只有keyboardDidShow和keyboardDidHide事件有效。
@param {function} jsFunction 事件触发时调用的js函数。
相关扩展:
The text was updated successfully, but these errors were encountered: