XCode:将故事板导出为图像

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

XCode: Export Storyboard to image

xcodeprintingstoryboard

提问by EZFrag

I have a slight issue... I need a huge XCode Storyboard in an image format so we can plot it on a plotter and mount it on one of the office walls. I have tried exporting it, but that only allows you to use storyboard format. Just trying to print it doesn't work either, as XCode cannot print storyboard files.

我有一个小问题......我需要一个巨大的图像格式的 XCode 故事板,这样我们就可以将它绘制在绘图仪上并将其安装在办公室的一面墙上。我试过导出它,但这只允许你使用故事板格式。只是尝试打印它也不起作用,因为 XCode 无法打印故事板文件。

Any solutions short of taking several screenshots and sowing them together wil be greatly appreciated.

除了截取多个屏幕截图并将它们一起播种之外的任何解决方案都将不胜感激。

Kind Regards, EZFrag

亲切的问候, EZFrag

回答by Adrian

Here it is the best hack I found :

这是我发现的最好的黑客:

Using a applescript it is possible to resize Xcode beyond screen size (it is possible even manually) :

使用 applescript 可以将 Xcode 的大小调整为超出屏幕大小(甚至可以手动):

set front_app to "Xcode"

tell application front_app
    activate
    set bounds of front window to {0, 0, 5000, 1000}
end tell

The maximum height seems to be the screen height, but it is possible to have the width much bigger than the screen's width.

最大高度似乎是屏幕高度,但宽度可能比屏幕宽度大得多。

Afterwards with a screen capture software it is possible to capture the entire Xcode window(beyond screen's bounds).

然后使用屏幕捕获软件可以捕获整个 Xcode 窗口(超出屏幕范围)。

In my test, I made 5 files for a 5000px x 5000px image. It is not the best option but it works. Hopefully Apple will add the print function or maybe somebody can automate the screen capture/stitch part.

在我的测试中,我为 5000px x 5000px 图像制作了 5 个文件。这不是最好的选择,但它有效。希望 Apple 会添加打印功能,或者有人可以自动化屏幕捕获/缝合部分。