缩小 Xcode Simulator (Retina 4 inch)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12957380/
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
Reduce the Xcode Simulator (Retina 4 inch)
提问by user1372829
I'm using macbook Air and using the iphone Simulator. I changed it to Retina 4 inch, and the screen of the simulator become so big! is there a way to reduce the size?
我正在使用 macbook Air 并使用 iphone Simulator。改成Retina 4寸,模拟器屏幕变大了!有没有办法减小尺寸?
回答by atxe
You can scale it with the following shortcuts:
您可以使用以下快捷方式对其进行缩放:
- ?+1: 100%
- ?+2: 75%
- ?+3: 50%
- ?+4: 33%
- ?+5: 25%
- ?+ 1: 100%
- ?+ 2: 75%
- ?+ 3: 50%
- ?+ 4: 33%
- ?+ 5: 25%
Or in iOS Simulator: Window > Scale > ...
或者在 iOS 模拟器中: Window > Scale > ...
回答by rmaddy
The iOS Simulator's Window menu has an option to display the simulator at 50%, 75%, or 100%. Try one of the smaller values to make it fit.
iOS 模拟器的窗口菜单有一个选项可以以 50%、75% 或 100% 显示模拟器。尝试较小的值之一以使其适合。
回答by Krunal
Now It's more flexible with Xcode 9-Simulator.
现在使用 Xcode 9-Simulator 更加灵活。
You can pick & drag any corner or simulator to resize it and set it according to your requirement.
您可以选择并拖动任何角落或模拟器以调整其大小并根据您的要求进行设置。
There are several other ways also, to scale your simulator.
还有其他几种方法可以扩展您的模拟器。
Using Terminal Command
Follow these steps to scale simulator using terminal commands
使用终端命令
按照以下步骤使用终端命令扩展模拟器
- Close/Quit simulator. (if open)
- Open
Terminal
app (using Spotlight search, Press? + SPACE
to open spotlight search) - Copy following text and paste it next to terminal cursor.
- 关闭/退出模拟器。(如果打开)
- 打开
Terminal
应用程序(使用 Spotlight 搜索,按? + SPACE
打开 Spotlight 搜索) - 复制以下文本并将其粘贴到终端光标旁边。
defaults write ~/Library/Preferences/com.apple.iphonesimulator SimulatorWindowLastScale "0.3"
defaults write ~/Library/Preferences/com.apple.iphonesimulator SimulatorWindowLastScale "0.3"
- Open 'Simulator' (Run your iOS project using Xcode).
- 打开“模拟器”(使用 Xcode 运行您的 iOS 项目)。
You will find simulator scale update.
您会发现模拟器比例更新。
Simulator scale options from Xcode Menu:
Xcode 菜单中的模拟器缩放选项:
Menubar >> Window >> Scale >> "Here available options for simulator scaling"
菜单栏 >> 窗口 >> 缩放 >> “此处为模拟器缩放的可用选项”
Here is ref snapshot:
这是参考快照: