Input text doesn't show keyboard on iOS simulator

谁说胖子不能爱 提交于 2019-12-21 03:22:11

问题


I'm building an app and I need to use an input text.

The problem comes when you tap on this input text, the keyboard doesn't appear.

I don't know why, I don't know what I'm doing wrong. It is supposed to be straightforward.

Here is some of my code:

<View style={ styles.storyContentContainer }>
    <TextInput ref='username' style={{width: 300, height: 20, borderWidth: 1,}}/>
</View>

And a video to show to you guys when the input text gets the focus nothing happen:

I hope you guys can help me with this issue.


回答1:


I assume you are running this on the iOS simulator? Turn off the host machine's hardware keyboard integration by unchecking Hardware > Keyboard > Connect Hardware Keyboard, or you can use the Keyboard Shortcut: Shift + Cmd + K, and the keyboard will appear when you focus on a TextInput.

You can also manually toggle the software keyboard visibility with Cmd +K.

On a real device the keyboard should work out-of-the-box as expected.



来源:https://stackoverflow.com/questions/34977588/input-text-doesnt-show-keyboard-on-ios-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!