Xcode 9.1 iOS 模拟器 Window > Physical Size 被禁用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47065709/
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 10:24:17  来源:igfitidea点击:

Xcode 9.1 iOS simulator Window > Physical Size disabled

xcodexcode9.1

提问by Worth

I need to make screen shots (specifically iPad Pro 12.9") for the App Store. I resized the simulator to fit it on my mac's screen. Now I can't resize it back to 100%, which is required to make a new screen shot. Both sizing options, Physical Size (Cmd-1) and Pixel Accurate (Cmd-2) are grayed out. How do I reset the simulator back to 100%?

我需要为 App Store 制作屏幕截图(特别是 iPad Pro 12.9")。我调整了模拟器的大小以适合我的 Mac 屏幕。现在我无法将其调整回 100%,这是制作新屏幕所必需的拍摄。两个尺寸选项,物理尺寸 (Cmd-1) 和像素准确度 (Cmd-2) 都变灰了。如何将模拟器重置回 100%?

Workaround:I was able to manually resize the simulator window using the mouse to grab the corner (the new way to adjust size in 9.1). Using trial-and-error by resizing, making new screen shots, and checking the resulting pixel dimensions, I was able to manually get it back to 100% (2048x2732). The original question still remains; is there a way to reset the simulator to 100% without using this workaround?

解决方法:我能够使用鼠标手动调整模拟器窗口的大小以抓住角落(9.1 中调整大小的新方法)。通过调整大小、制作新屏幕截图和检查生成的像素尺寸,我能够通过反复试验将其手动恢复到 100% (2048x2732)。最初的问题仍然存在;有没有办法在不使用此解决方法的情况下将模拟器重置为 100%?

采纳答案by Gabriel Castro

Just resize up the simulator window dragging until the size reaches a size greater than or equal the original size, this worked for me.

只需调整模拟器窗口的大小,直到大小达到大于或等于原始大小的大小,这对我有用。

回答by Hugo Jordao

I could get the screen shot with resolution of (2048x2732) deactivating the option of "Optimize Rendering for Window Scale"

我可以获得分辨率为 (2048x2732) 的屏幕截图,停用“优化窗口比例渲染”选项

Simulator/Debug/Optimize Rendering for Window Scale

模拟器/调试/优化窗口比例渲染

回答by Piotr

The real reason why the pixel accurate size option is greyed out is because your screen resolution is too low to fit the device with that size. Solution is to increase your screen resolution temporarily under system settings > display in mac os.

像素精确尺寸选项变灰的真正原因是您的屏幕分辨率太低,无法适应具有该尺寸的设备。解决方案是在系统设置 > 在 mac os 中显示下临时提高您的屏幕分辨率。

回答by Kandeep

On Simulator 10.0 (Xcode 9.4.1)

在模拟器 10.0 (Xcode 9.4.1) 上

Hardware >Rotate Left or Rotate Right

硬件>向左旋转或向右旋转

and this will re-enable Physical Size selection (Window >Physical Size) if it got disabled/ grayed out

如果它被禁用/变灰,这将重新启用物理大小选择(窗口>物理大小)

回答by sshic

In xcode(mine is 9.1), uncheck Window->Show Device Brezels to make changes on simulator, then check it to make screenshots.

在 xcode(我的是 9.1)中,取消选中 Window->Show Device Brezels 以在模拟器上进行更改,然后选中它以制作屏幕截图。

回答by Jami

Though resizing of simulator using Cmd + 1...5 is now disable however, you can resize it by dragging simulator with pointeris available like any normal window on OS X. You can resize it by dragging simulator either from right or left or bottom.

虽然现在禁用使用 Cmd + 1...5 调整模拟器的大小,但是您可以通过拖动模拟器来调整它的大小,指针与OS X上的任何普通窗口一样可用。您可以通过从右侧或左侧或底部拖动模拟器来调整其大小。

回答by Jarvan

1.Close/Quit simulator

1.关闭/退出模拟器

2.Xcode 9.1 >> Window >> “Devices and Simulartors” >> "Simulartors", then remember the device identifier you want to set

2.Xcode 9.1 >> Window >> “Devices and Simulartors” >> “Simulartors”,然后记住你要设置的设备标识符

enter image description here

在此处输入图片说明

3.Then open the file

3.然后打开文件

~/Library/Preferences/com.apple.iphonesimulator

~/Library/Preferences/com.apple.iphonesimulator

4.Find out simulator device id you want to set

4.找出你要设置的模拟器设备id

5.Set "SimulatorWindowLastScale" value = 1

5.设置“SimulatorWindowLastScale”值=1

enter image description here

在此处输入图片说明

回答by Rahul K Rajan

You can make it to default size by pressing the Zoom option in the simulator window option.The Zoom option will get enable when the physical size is selected.enter image description here

您可以通过按模拟器窗口选项中的缩放选项将其设置为默认大小。选择物理大小后,缩放选项将启用。在此处输入图片说明

回答by bio

I have an Apple Thunderbolt Display, and the Simulator shrinks the window to fit the display. However, if I press Cmd+S to make the screenshot the resulting PNG still has the 100% size of 2048x2732. No need to play with bezels or corners :-)

我有一个 Apple Thunderbolt 显示器,模拟器缩小了窗口以适应显示器。但是,如果我按 Cmd+S 来制作屏幕截图,生成的 PNG 仍然具有 2048x2732 的 100% 大小。无需玩边框或角落:-)

回答by ostiepoK

Using Xcode 11 the "Optimize Rendering for window scale" is not present anymore. Just select default simulator for iPhone Pro Maxand make screenshot with ? + S

使用 Xcode 11,“优化窗口比例渲染”不再存在。只需为iPhone Pro Max选择默认模拟器并使用? + S

You will have 1242 x 2688 px screenshots saved on Desktop

您将在桌面上保存 1242 x 2688 像素的屏幕截图