缩小 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

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

Reduce the Xcode Simulator (Retina 4 inch)

iosxcodeios-simulatorretina-display

提问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.

您可以选择并拖动任何角落或模拟器以调整其大小并根据您的要求进行设置。

enter image description here

在此处输入图片说明


There are several other ways also, to scale your simulator.


还有其他几种方法可以扩展您的模拟器。

Using Terminal Command
Follow these steps to scale simulator using terminal commands

使用终端命令
按照以下步骤使用终端命令扩展模拟器

  1. Close/Quit simulator. (if open)
  2. Open Terminalapp (using Spotlight search, Press ? + SPACEto open spotlight search)
  3. Copy following text and paste it next to terminal cursor.
  1. 关闭/退出模拟器。(如果打开)
  2. 打开Terminal应用程序(使用 Spotlight 搜索,按? + SPACE打开 Spotlight 搜索)
  3. 复制以下文本并将其粘贴到终端光标旁边。

defaults write ~/Library/Preferences/com.apple.iphonesimulator SimulatorWindowLastScale "0.3"

defaults write ~/Library/Preferences/com.apple.iphonesimulator SimulatorWindowLastScale "0.3"

  1. Open 'Simulator' (Run your iOS project using Xcode).
  1. 打开“模拟器”(使用 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: enter image description here

这是参考快照: 在此处输入图片说明