输入文字未在iOS模拟器上显示键盘 [英] Input text doesn't show keyboard on iOS simulator
问题描述
我正在构建一个应用程序,我需要使用输入文本.
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.
这是我的一些代码:
<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.
推荐答案
我假设您正在iOS模拟器上运行此程序?通过取消选中Hardware > Keyboard > Connect Hardware Keyboard
来关闭主机的硬件键盘集成,或者可以使用键盘快捷键: Shift + Cmd + K ,然后当您将焦点放在TextInput
上时,键盘将出现.
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
.
您还可以使用 Cmd + K 手动切换软件键盘的可见性.
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.
这篇关于输入文字未在iOS模拟器上显示键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!