输入文字未在iOS模拟器上显示键盘 [英] Input text doesn't show keyboard on iOS simulator

查看:185
本文介绍了输入文字未在iOS模拟器上显示键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个应用程序,我需要使用输入文本.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆