本文翻译自:Xcode 6: Keyboard does not show up in simulator
The keyboard does not show up when I run the simulator and click in the UITextView. 当我运行模拟器并单击UITextView时,键盘没有显示。 How do I re-enable the keyboard? 如何重新启用键盘?
It used to work but now it doesn't - I don't know what I might have clicked by accident... any tips would be appreciated! 它曾经可以工作,但现在却不起作用-我不知道我可能偶然点击了什么……任何提示将不胜感激!
参考:https://stackoom.com/question/1eSz3/Xcode-键盘未显示在模拟器中
It would be difficult to say if there's any issue with your code without checking it out, however this happens to me quite a lot in (Version 6.0 (6A216f)). 如果不检出代码,很难说出代码是否存在问题,但是在(版本6.0(6A216f))中,我经常遇到这种情况。 I usually have to reset the simulator's Content and Settings and/or restart xCode to get it working again. 通常,我必须重置模拟器的“内容和设置”和/或重新启动xCode才能使其再次运行。 Try those and see if that solves the problem. 试试看,看看是否能解决问题。
I had the same issue. 我遇到过同样的问题。 My solution was as follows: 我的解决方案如下:
Mine was checked because I was using my mac keyboard, but if you make sure it is unchecked the iPhone keyboard will always come up. 我的Mine已被检查,因为我使用的是Mac键盘,但如果确保未选中,则iPhone键盘将始终出现。
While testing in the ios8 beta simulator, you may toggle between the "software keyboard" and "hardware keyboard" with ⌘ + K . 在ios8 beta模拟器中进行测试时,您可以使用⌘ + K在“软件键盘”和“硬件键盘”之间切换。
UPDATE : Since iOS Simulator 8.0, the shortcut is ⇧ + ⌘ + K . 更新 :自iOS Simulator 8.0起,快捷方式为⇧ + ⌘ + K。
Simulator -> Hardware -> Keyboard -> Toggle Software Keyboard should solve this problem. 模拟器->硬件->键盘->切换软件键盘应解决此问题。
您可以使用: ⇧ + ⌘ + K在模拟器上显示键盘。