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

查看:50
本文介绍了输入文本在 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 > 来关闭主机的硬件键盘集成.键盘 >连接硬件键盘,也可以使用键盘快捷键: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天全站免登陆