自适应布局

编程入门 行业动态 更新时间:2024-10-28 16:28:54
自适应布局 - 卸载视图时出错 - Xcode(Adaptive Layout - Error With Uninstalled View - Xcode)

在IB中,我构建了一个视图。 在该视图中,有一个特定的子视图,我只想在常规/常规时在iPad上显示。 我在线指南的理解是,我可以通过相应地检查“已安装”框来实现:

但是,这会导致错误“在当前配置中关闭引用项目的约束......”。 但如果我在R / R并且我的所有观点都显示出来,那怎么可能呢?

故障排除1

为了解决它,对于紧凑/紧凑和紧凑/常规我也卸载了约束!

故障排除2

我找到了一个教程,展示了如何右键单击该警告消息并在日志中找到实际约束。 我将约束ID复制/粘贴到查找栏中,这是我的导向到超级视图约束。 我卸载了R / R以外的所有约束,但我仍然得到错误。

显然我在这里做错了什么,但是什么?

In IB I built a view. Within that view there's a particular subview which I only want to have show on the iPad when it's regular/regular. My understanding from online guides is that I can do that by checking the "Installed" boxes accordingly:

However, this caused an error saying "Constraint referencing items turned off in current configuration...". But if I'm in R/R and ALL my views are showing, how is that even possible?

Troubleshooting 1

To try to solve it, for the compact/compact and compact/regular I uninstalled the constraints too!

Troubleshooting 2

I found a tutorial showing how to right click that warning message and find the actual constraint in the log. I copy/pasted the constraint ID into the Find bar and it was my leading-to-superview constraint. I uninstalled that constraint for everything but R/R yet I still get the error.

Question

Obviously I'm doing something wrong here, but what?

最满意答案

这里没什么“奇怪的”。 如果视图仅存在于wRhR ,那么显然任何涉及该视图的约束最好仅存在于wRhR 。 一个没有它所引用的视图的约束 - 会很奇怪!

至于你问题的第二部分,你没有提供允许任何人帮助你的信息。 您可以轻松查看故事板,它将告诉您现在需要约束的视图,并且您必须提供它们(可能只是在wRhR情况下)。

There's nothing "strange" here. If a view is present only in wRhR, obviously any constraint involving that view had better be present only in wRhR. A constraint without one of the views to which it refers — that would be strange!

As for the second part of your question, you have given no information that would allow anyone to assist you. You can easily look at the storyboard and it will tell you what view now needs constraints, and you will have to supply them (probably just in the wRhR case).

更多推荐

本文发布于:2023-08-02 04:37:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1368501.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自适应   布局

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!