如何为 Interface Builder 对象分配不同的 z 顺序?

发布于 2024-11-05 22:03:03 字数 154 浏览 5 评论 0原文

如何更改 z 值,或者仅将其发送到 Interface Builder 中的对象的后面或前面?

即我想移动到此视图中的“标签”前面:

example image

How can I change the z-value, or just send to back or to front the objects in Interface Builder?

i.e. I would like to move to front the "Label" in this View:

example image

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

老子叫无熙 2024-11-12 22:03:04

然后您需要在 Interface Builder 中重新排序。看来您正在使用 Xcode 4。因此,首先,单击 IB 左下角的箭头以展开侧面板:

在此处输入图像描述

接下来,单击并拖动您要重新排列的视图。

在此处输入图像描述

项目在列表中距离列表顶部越低,其“z-index”越高”。

You need to reorder then in Interface Builder. It seems like you're using Xcode 4. So, first, click on the arrow in the bottom left corner of IB to expand the side panel:

enter image description here

Next, click and drag the views that you'd like to rearrange.

enter image description here

The lower an item is on the list from the top of the list, the higher its "z-index".

不甘平庸 2024-11-12 22:03:04

选择该对象后,转到(菜单)Editor>Arrangement>。 。将有 4 个选项,并激活相应的选项。

with that object selected, goto (menu) Editor>Arrangement> . There will be 4 options with activated appropriate options.

梦里寻她 2024-11-12 22:03:04

xCode 10.3 (2019):

我在复制/粘贴背景图像视图时遇到了同样的问题。我无法在文档大纲面板(在 Interface Builder 中)中拖动它来更改其 z 顺序。

答案就是重新启动xCode

我认为重新索引/重新构建故事板,我可以将其拖动到列表中的更高位置(从而使其在 z 顺序中较低+位于其他控件后面)。

xCode 10.3 (2019):

I had the same problem when copying/pasting a background image view. I couldn't drag it to change its z-order in the Document Outline panel (in Interface Builder).

The answer was just to restart xCode.

I think that re-indexed/re-built the storyboard and I could drag it higher in the list (thus making it lower in the z-order + behind the other controls).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文