简体   繁体   English

如何在不按 TextInput 的情况下在 React Native 中打开 Android 和 IOS 键盘

[英]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.

相关问题 如何在不使用键盘onLongPress的情况下在TextInput上打开上下文菜单(React Native) - How to open context menu without keyboard onLongPress on TextInput (React Native) React Native android:如何在按下“actionNext”键盘按钮后选择下一个TextInput? - React Native android: How to select the next TextInput after pressing the “actionNext” keyboard button? React Native Keyboard 涵盖 Android 上的 TextInput KeyboardAvoidingView - React Native Keyboard covers TextInput KeyboardAvoidingView on Android React Native android TextInput 无法显示键盘 - React Native android TextInput fail to show keyboard 如何在react-native中将TextInput附加到键盘 - How to attach TextInput to the keyboard in react-native 如何获取TextInput值而不使用反应原生android中的状态 - how to get TextInput value without using state in react native android React-Native:按下键盘 (textInput) 会导致 header 滑出屏幕。 怎么能保持在同一个position? - React-Native: Pressing on the keyboard (textInput) causes the header to slide off the screen. How can it be kept in the same position? 没有点和逗号的 React-Native TextInput 数字键盘 - React-Native TextInput numeric keyboard without dot and comma React-Native 有焦点但没有键盘显示的 TextInput - React-Native TextInput with focus but without keyboard showing React Native android TextInput 在切换到表情符号时在键盘下消失 - React Native android TextInput disappears under keyboard when changing to emoticons
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM