xcode 如何删除 iPad 模拟器中的灰色底栏

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33480463/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:09:20  来源:igfitidea点击:

How to remove the grey bottom bar in iPad simulator

iosxcodeipadios-simulatorxcode7

提问by Vladimír Slavík

I have tried to reset the simulator, to change the keyboard input settings, to rotate the simulator, but it did not change anything.

我尝试重置模拟器,更改键盘输入设置,旋转模拟器,但它没有改变任何东西。

The grey bar covers my ui so that the simulator is not usable.

灰色条覆盖了我的 ui,因此模拟器无法使用。

XCode version: 7.1 (7B91b) Simulator version: 9.1 (SimulatorApp-635.5)

XCode 版本:7.1 (7B91b) 模拟器版本:9.1 (SimulatorApp-635.5)

enter image description here

在此处输入图片说明

回答by Loz

To hide this bar you need to go into the Settings.app within the simulator (tap the gears icon on the home screen), then General->Keyboard, and turn off the 'Shortcuts' toggle.

要隐藏此栏,您需要进入模拟器中的 Settings.app(点击主屏幕上的齿轮图标),然后点击 General->Keyboard,并关闭“Shortcuts”切换。

I have this issue in my app constantly, and cannot for the life of me figure out whythe bar is showing in the first place. The firstResponderidea mentioned by James seems like a sensible place to start looking, but bizarrely this is appearing on everyscreen, no matter if it has a text field in it or not. Perhaps it is an Apple bug after all.

我的应用程序中不断出现这个问题,并且我一生都无法弄清楚为什么栏首先显示。firstResponderJames 提到的想法似乎是一个明智的开始寻找的地方,但奇怪的是,这出现在每个屏幕上,无论它是否有文本字段。也许这毕竟是Apple的错误。

Handy hint... if you are looking for a way to set the Shortcuts keyboard option from the command line (eg. when doing https://github.com/fastlane/snapshot), the following command does the trick:

方便的提示...如果您正在寻找一种从命令行设置快捷方式键盘选项的方法(例如,在执行https://github.com/fastlane/snapshot 时),以下命令可以解决问题:

find ~/Library/Developer/CoreSimulator/Devices -path */data/Library/Preferences/com.apple.Preferences.plist | xargs -n 1 -I {} defaults write "{}" KeyboardAssistant -bool NO

find ~/Library/Developer/CoreSimulator/Devices -path */data/Library/Preferences/com.apple.Preferences.plist | xargs -n 1 -I {} defaults write "{}" KeyboardAssistant -bool NO

(it finds all the Settings.app plists for all simulators and writes NOinto the KeyboardAssistantkey)

(所有它找到的所有模拟器的Settings.app的Plist并写入NOKeyboardAssistant键)

回答by James

The grey bar is the shortcut bar that shows when the iPad is connected to an external keyboard. It should show when a text field has the first responder edit focus.

灰色栏是 iPad 连接外接键盘时显示的快捷栏。它应该显示文本字段何时具有第一响应者编辑焦点。

When you are in the simulator, you can simulatethis and have the software keyboard not show.

当你在模拟器中时,你可以模拟这个并且不显示软键盘。

When I am in the simulator, there is a "V" control on the far right that dismisses the bar.

当我在模拟器中时,最右侧有一个“V”控件,可以关闭该条。

Try scrolling to the right with two fingers to find this control. You may also need to use a 50% or smaller scale in Window->Scale to see more of your interface.

尝试用两根手指向右滚动以找到此控件。您可能还需要在 Window->Scale 中使用 50% 或更小的比例来查看更多界面。

Also try toggling the software keyboard with command K or in the menu at Hardware -> Keyboard.

还可以尝试使用命令 K 或在硬件 -> 键盘的菜单中切换软件键盘。

If you are not seeing it, you have some Simulator bug that I have not seen.

如果你没有看到它,你有一些我没有看到的模拟器错误。

For what it is worth, remember that you need to adapt to the much bigger software keyboard appearing and disappearing in you interface as text entry fields get to be the firstResponder. Search StackOverflow or Apple docs for the many ways of moving controls out of the way so you can see them.

值得一提的是,请记住,当文本输入字段成为第一个响应者时,您需要适应在界面中出现和消失的更大的软件键盘。搜索 StackOverflow 或 Apple 文档,了解将控件移开以便您可以看到它们的多种方法。

回答by Suragch

Here is a supplemental image. I didn't understand at first what was being described in Loz's answer.

这是一张补充图片。起初我不明白 Loz 的回答中描述的是什么。

enter image description here

在此处输入图片说明