当我运行模拟器并在UITextView中单击时,键盘不会显示。如何重新启用键盘?
它曾经有效,但现在不行了——我不知道我可能偶然点击了什么。
当我运行模拟器并在UITextView中单击时,键盘不会显示。如何重新启用键盘?
它曾经有效,但现在不行了——我不知道我可能偶然点击了什么。
当前回答
如果模拟器中没有自动显示键盘,只需按[Command+K]
或硬件->键盘->切换软件键盘
其他回答
在移除新模拟器硬件选项时,
如果要手动查找键盘选项,请单击I/O部分,
I/O->键盘->切换软件键盘(¨K)
为了启用/禁用模拟器键盘,
⑪+K(Ctrl+K)
要禁用键盘输入,
iOS模拟器->硬件->键盘->取消选中“连接硬件键盘”
只需按K键即可切换键盘。
使用脚本您可以通过Xcode预运行操作运行
/usr/libexec/PlistBuddy -c "Print :DevicePreferences"
~/Library/Preferences/com.apple.iphonesimulator.plist | perl -lne 'print
$1 if /^ (\S*) =/' | while read -r a; do /usr/libexec/PlistBuddy -c
"Set :DevicePreferences:$a:ConnectHardwareKeyboard false"
~/Library/Preferences/com.apple.iphonesimulator.plist || /usr/libexec/PlistBuddy -c "Add :DevicePreferences:$a:ConnectHardwareKeyboard bool false" ~/Library/Preferences/com.apple.iphonesimulator.plist; done
您可以使用:⇧+⌘+K在模拟器上显示键盘。