[英]How to open Android and IOS keyboard in React Native without pressing the TextInput
I am working on the comment section of an Android and iOS application in react native, the problem is that I try to open the keyboard when the user clicks on the "Reply to comment" button.我正在使用 React Native 处理 Android 和 iOS 应用程序的评论部分,问题是当用户单击“回复评论”按钮时我尝试打开键盘。 If you can help me by guiding me how to bring up the keyboard just by tapping on a button, or by tapping anywhere but not on the TextInput.
如果你能帮助我指导我如何通过点击按钮调出键盘,或者通过点击任何地方而不是 TextInput 来调出键盘。 the best would be to link a TextInput with a button to display the keyboard which will enter the data in the TextInput
最好的方法是将 TextInput 与按钮链接以显示将在 TextInput 中输入数据的键盘
Merci.谢谢。
This is related to https://stackoverflow.com/a/42456639/20717090这与https://stackoverflow.com/a/42456639/20717090有关
The keyboard should open automatically when a
<TextField/>
is focused.当
<TextField/>
获得焦点时,键盘应该会自动打开。 You can use the autoFocus prop to make it focus when the element mounts ( doc )您可以使用 autoFocus 道具使其在元素安装时聚焦( doc )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.