React native React Native:关闭键盘并保持文本输入的焦点
我尝试了所有的方法,但当我关闭键盘时,焦点也模糊了。但是,当我想让用户将信息粘贴到文本输入时,我不愿意显示软键盘React native React Native:关闭键盘并保持文本输入的焦点,react-native,React Native,我尝试了所有的方法,但当我关闭键盘时,焦点也模糊了。但是,当我想让用户将信息粘贴到文本输入时,我不愿意显示软键盘 <TextInput ref='barcodeInput' style={{height: 60,borderColor: '#000000', borderWidth: 1, width:300, fontSize:30}} underlineColorAndroid="transparent" onChangeText={(text) =&g
<TextInput
ref='barcodeInput'
style={{height: 60,borderColor: '#000000', borderWidth: 1, width:300, fontSize:30}}
underlineColorAndroid="transparent"
onChangeText={(text) => this.setState({inputBarcode:text})}
onSubmitEditing={this.handleSubmitEditing.bind(this)}
keyboardType = {'numeric'}
/>
this.setState({inputBarcode:text})
onSubmitEditing={this.handleSubmitEditing.bind(this)}
键盘类型={'numeric'}
/>
您应该能够使用react native
中的键盘组件。例如:
import { Keyboard } from 'react-native'
Keyboard.dismiss()
焦点仍应保持在输入上,但软键盘将消失。这对我不起作用。Keyboard.disclose()隐藏键盘,但同时删除焦点。有什么特别的方法可以使用吗?这个答案是无效的,RN的文档说明了与discouse
函数相反的情况:。是否找到了解决方案?我发现模糊文本输入的概念被灌输到键盘中,这太疯狂了。在没有给出防止这种行为的选项的情况下,就放弃。