简体   繁体   中英

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. 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. the best would be to link a TextInput with a button to display the keyboard which will enter the data in the TextInput

Merci.

This is related to https://stackoverflow.com/a/42456639/20717090

The keyboard should open automatically when a <TextField/> is focused. You can use the autoFocus prop to make it focus when the element mounts ( doc )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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