ios Xcode - 重复的故事板场景

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

Xcode - duplicate Storyboard scene

iosxcodeuistoryboard

提问by Ben Mosher

Is there a quick way to duplicate a scene in Xcode's storyboard editor?

有没有一种快速的方法可以在 Xcode 的故事板编辑器中复制场景?

I'm looking for something akin to using option-drag to duplicate UI elements (UIButton, etc.) within a scene (or nib file). Copy-paste works, but awkwardly.

我正在寻找类似于使用 option-dragUIButton在场景(或 nib 文件)中复制 UI 元素(等)的方法。复制粘贴有效,但笨拙。

回答by Ben Mosher

I'm just using Command+ D(Duplicate) for now, as it (AFAIK) is essentially a one-step copy-paste, and dealing with the bug.

我现在只使用Command+ D(重复),因为它(AFAIK)本质上是一步复制粘贴,并处理错误。

回答by Vien Vu

You can duplicate views if you drag them with ALT key. it does quickly

如果使用 ALT 键拖动它们,则可以复制视图。它很快

回答by Achyut Sagar

Select the ViewController you want to duplicate. press Command+C(copy) then Command+V(paste).

选择要复制的 ViewController。按Command+C(复制)然后Command+V(粘贴)。

回答by Nick ONeill

The new command is Shift+Command+S. You can also optionally click Fileand then Duplicate.

新命令是Shift+Command+S. 您也可以选择单击File,然后单击Duplicate

回答by Rick

You can duplicate a view (or scene) easily by selecting the whole view, then copy and paste.

您可以通过选择整个视图轻松复制视图(或场景),然后复制和粘贴。

To copy and paste UI elements, select the element you want to copy, then copy it and paste it in the original view. Then drag the newly pasted element to the new view. Everything mouse-based.

要复制和粘贴 UI 元素,请选择要复制的元素,然后将其复制并粘贴到原始视图中。然后将新粘贴的元素拖到新视图中。一切都基于鼠标。