xcode 移动故事板中其他对象后面的对象

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

Moving objects that are behind other objects in Storyboard

xcodeinterface-builderstoryboard

提问by Alan

I often stack objects in IB/Storyboard it's almost impossible to drag objects that are behind other objects without moving the objects in front. Is there anyway I can move the objects that are already selected but are behind other objects? It always selects the object that's at the top when I try to move it or do I have to bring it to the front and move it and then send it back to the back?

我经常在 IB/Storyboard 中堆叠对象,几乎不可能在不移动前面的对象的情况下拖动其他对象后面的对象。无论如何我可以移动已经选择但位于其他对象后面的对象吗?当我尝试移动它时,它总是选择顶部的对象,还是我必须将它带到前面并移动它然后再将它发送回后面?

Thanks! Alan

谢谢!艾伦

回答by nvrtd frst

Control + Shift + Click on an object in Interface Builder to see a menu of all of the objects under the mouse.

Control + Shift + 单击 Interface Builder 中的一个对象以查看鼠标下所有对象的菜单。

From: https://stackoverflow.com/a/934152/1374512

来自:https: //stackoverflow.com/a/934152/1374512

回答by laoyur

Still no enough reputations to add comment, so I have to make a comment as an answer.

仍然没有足够的声誉来添加评论,所以我必须发表评论作为答案。

As @nvrtd mentioned, you can hold Ctrl+ Shiftand then click to show controls selection popup.

正如@nvrtd 提到的,您可以按住Ctrl+Shift然后单击以显示控件选择弹出窗口。

but as @David said, in that way you can only select rather than drag/move using mouse:

但正如@David 所说,这样你只能选择而不是使用鼠标拖动/移动:

That doesn't work for me. I can select it, but can't move it.

那对我不起作用。我可以选择它,但不能移动它。

my solution:

我的解决方案:

  1. select the control first
  2. move the control with keyboard arrow keys
  1. 首先选择控件
  2. 使用键盘箭头键移动控件

回答by user3069232

You could also change the order of the objects, depending on your design... might be a solution. See SO here.

您还可以根据您的设计更改对象的顺序......可能是一个解决方案。请参阅此处。

How to send objects in NIB files to front/back?

如何将 NIB 文件中的对象发送到前/后?