xcode 当模拟器的“精确像素”选项被禁用时,如何获得全分辨率屏幕截图?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/47068446/
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
How can I get full-resolution screenshots when the Simulator's "Pixel Accurate" option is disabled?
提问by Crashalot
On Xcode 9.1 the Pixel Accurate
option is disabled and grayed out under the Window
menu.
在 Xcode 9.1 上,该Pixel Accurate
选项被禁用并在Window
菜单下变灰。
How can I take App Store screenshots without this option?
如果没有此选项,我如何截取 App Store 屏幕截图?
回答by Crashalot
The original answer is wrong!
原来的答案是错误的!
Russ from the Apple Simulator team says:
来自 Apple Simulator 团队的 Russ 说:
To take app store screenshots uncheck the "Optimize rendering for Window Scale" option in the Debug menu. I recommend turning this back on normally as it improves rendering performance. Double-clicking does not make the device use native resolution, that's just an accident due to the size of device you tested with and the size of your screen.
要获取应用商店屏幕截图,请取消选中“调试”菜单中的“优化窗口缩放的渲染”选项。我建议正常重新打开它,因为它可以提高渲染性能。双击不会使设备使用原始分辨率,这只是由于您测试的设备大小和屏幕大小而造成的意外。
==========
==========
ORIGINAL ANSWER (DOES NOT WORK RELIABLY):
原始答案(不可靠):
Make sure Window -> Show Device Bezelsis unchecked.
Double click the simulator's toolbar (the top bar listing the device and OS).
确保Window -> Show Device Bezels未选中。
双击模拟器的工具栏(顶部栏列出设备和操作系统)。
Note - sometimes, double-clicking the toolbar will just minimize the window to the dock. Alternately, simply click OSX menubar Window->Zoom.
注意 - 有时,双击工具栏只会将窗口最小化到停靠栏。或者,只需单击 OSX 菜单栏窗口->缩放。
Hello happy days, the simulator resizes and provides the right resolution for App Store screenshots.
你好,快乐的日子,模拟器会调整大小并为 App Store 屏幕截图提供正确的分辨率。
回答by Leo
You could set the simulator to landscape mode by clicking ?
+ →
first, then you could click ?
+ 2
to select Pixel Accurate
option, don't forget set simulator to portrait mode by clicking ?
+ ←
:)
您可以先单击?
+将模拟器设置为横向模式→
,然后单击?
+2
选择Pixel Accurate
选项,不要忘记单击?
+将模拟器设置为纵向模式←
:)
回答by russbishop
We don't enable that option unless your screen is large enough to display the device at the full resolution without running off the edges.
我们不会启用该选项,除非您的屏幕足够大,可以以全分辨率显示设备而不会超出边缘。
As an aside: If you have "Optimize rendering for window scale" enabled that causes the Simulator to render at the size of the window, not the native resolution of the device. That means screenshots are at the window's scaled size, not full device size. To get full-size screenshots you can temporarily disable that option. I recommend leaving it on otherwise because it improves performance.
顺便说一句:如果您启用了“针对窗口比例优化渲染”,则会导致模拟器以窗口大小而不是设备的原始分辨率进行渲染。这意味着屏幕截图是窗口的缩放大小,而不是完整的设备大小。要获得全尺寸屏幕截图,您可以暂时禁用该选项。否则我建议将其保留,因为它可以提高性能。
edit: We removed the "Optimize rendering for window scale" option. It caused too much confusion. Now you always get full-size screenshots.
编辑:我们删除了“优化窗口比例渲染”选项。它引起了太多的混乱。现在您总能获得全尺寸屏幕截图。
回答by Julian Ko
I found the menu is only enabled when your screen resolution is able to support pixel accurate display( so as physical size). This is annoying because making a screenshot always generates a picture at the current size of the simulator on Xcode 9.1. It requires to the simulator to display in the pixel-accurate mode for qualified screenshots. For iPad Pro(12.9-in, 2732 x 2048 pixels), the mode is only available in landscape when my MacBook Pro is set to "More Space"- with actual resolution at 3840x2400.
我发现菜单仅在您的屏幕分辨率能够支持像素精确显示(例如物理尺寸)时启用。这很烦人,因为制作屏幕截图总是会在 Xcode 9.1 上以模拟器的当前大小生成图片。它要求模拟器以像素精确模式显示合格的屏幕截图。对于 iPad Pro(12.9 英寸,2732 x 2048 像素),当我的 MacBook Pro 设置为“更多空间”时,该模式仅在横向模式下可用 - 实际分辨率为 3840x2400。
回答by dme881
Since the computer I own (2017 MacBook Air) don't support landscape mode and resolution is 1440x1000 I'm stuck. In Xcode 9.0 you could still select 100% scaling and scroll down in the simulator. That's no longe possible.
由于我拥有的计算机(2017 MacBook Air)不支持横向模式并且分辨率为 1440x1000,我被卡住了。在 Xcode 9.0 中,您仍然可以选择 100% 缩放并在模拟器中向下滚动。那已经不可能了。
I can understand if apple drops support for 2005 computers, but not 1 month old ones :S
我可以理解苹果是否会放弃对 2005 年计算机的支持,而不是对 1 个月大的计算机的支持:S
So the only option I could find is to buy a extra screen! BUT for just making a screenshot you can still press CMD+S and it will make a native resolution one!
所以我能找到的唯一选择就是买一个额外的屏幕!但是只是制作屏幕截图,您仍然可以按 CMD+S ,它会生成原始分辨率!
回答by yura910721
Since I only needed to take a screenshot, I found out the quick fix was to go to "Hardware" > "Rotate Left"/"Rotate Right" and "Pixel/Point accurate" becomes available.
由于我只需要截取屏幕截图,我发现快速解决方法是转到“硬件”>“向左旋转”/“向右旋转”,然后“像素/精确点”可用。
回答by Ethan
In case this helps anyone else, the issue for me was my second monitor. I tried all of the solutions here, but none of them worked until i unplugged my second display. I work on a 15" 2016 MBP and the second display is a 2560×1440 QHD Asus monitor connected by HDMI to a USB-C hub.
如果这对其他人有帮助,我的问题是我的第二台显示器。我在这里尝试了所有解决方案,但在我拔下第二台显示器之前,它们都不起作用。我在 15" 2016 MBP 上工作,第二台显示器是 2560×1440 QHD 华硕显示器,通过 HDMI 连接到 USB-C 集线器。
回答by Shayan
Quick fix:
快速解决:
Hardware > Device > Manage Devices >Delete the iPhone that you're having trouble with (from the sidebar). [Remember to "Close Window" on Simulator and exit Simulator before deleting]
Add it again from the "+" button on the bottom left.
Restart Simulator and launch the device again.
Done.
硬件 > 设备 > 管理设备 >删除您遇到问题的 iPhone(从侧边栏)。【删除前记得在模拟器上“关闭窗口”并退出模拟器】
从左下角的“+”按钮再次添加它。
重新启动模拟器并再次启动设备。
完毕。