简体   繁体   English

禁用键盘 :: TextInput React Native

[英]Disable Keyboard :: TextInput React Native

The below given code is working on first time and on second time click on same text input it is not working ( keyboard opening again ).下面给出的代码第一次工作,第二次点击相同的文本输入它不起作用(键盘再次打开)。 Because the text input is already focused and i am using custom number buttons for input.因为文本输入已经聚焦并且我使用自定义数字按钮进行输入。

TextInput onFocus={Keyboard.dismiss()} TextInput onFocus={Keyboard.dismiss()}

Any suggestions?有什么建议? Problem in react native.反应原生的问题。

 <TextInput showSoftInputOnFocus={false}/>

Use showSoftInputOnFocus.使用 showSoftInputOnFocus。 reference 参考

use can use onKeyPress event, which gets called on every keypress on the textinput use 可以使用 onKeyPress 事件,该事件在 textinput 上的每次按键时被调用

https://facebook.github.io/react-native/docs/textinput#onkeypress https://facebook.github.io/react-native/docs/textinput#onkeypress

<TextInput onKeyPress={Keyboard.dismiss()}/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM