如何组织具有许多重叠元素的 XIB 文件?

发布于 2024-09-01 17:32:21 字数 334 浏览 2 评论 0原文

我有一些很难编辑的 XIB 文件,因为许多子视图彼此完全重叠。例如,如果我将弹出音量滑块放置在它将弹出的位置,它会覆盖一些无法单击的 UILabel。我能够编辑它们的唯一机会是在文档窗口树中双击它们,将它们移到一边,编辑,然后将它们移回。有时,XIB 中会有 3 个或更多小部件占据同一位置,即使应用程序运行时一次只有几个小部件可见。

有条件可见的屏幕元素实际上应该如何组织?

我希望能够隐藏视图组以显示它们下面的内容,但我在 IB 中看不到这样做的方法。

如果我为每个组创建 UIViewController,我可以在单独的窗口中编辑它们,但我无法在上下文中看到它们,并且我需要很多视图控制器......

I have some XIB files which are very difficult to edit because many of the subviews overlap each other completely. For example, if I position a popup volume slider where it will pop up, it covers some UILabels which become impossible to click. My only chance to be able to edit them is to double-click on them in the Document window tree, move them aside, edit, then move them back. Sometimes there are 3 or more widgets that occupy the same location in the XIB, even though only a few are visible at a time while the application is running.

How are conditionally-visible screen elements actually supposed to be organized?

I would like to be able to hide groups of views to reveal what's beneath them, but I don't see a way to do that in IB.

If I create UIViewControllers for every group, I can edit them in separate windows, but I can't see them in context, and I need a lot of view controllers...

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

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

发布评论

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

评论(1

长亭外,古道边 2024-09-08 17:32:21

提示:按住 Shift 键的同时右键单击要选择的对象的位置。

我不认为 IB 能够在设计时隐藏视图组,但是您没有理由不能使用 IB 插件自己添加该行为。

Tip: Hold down shift while right clicking the location of the object you wish to select.

I don't think IB is able to hide groups of views during design-time, but there's no reason you couldn't add that behavior yourself using an IB plugin.

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