什么是“UIView的封装,布局宽度”的约束? [英] What is a 'UIView-Encapsulated-Layout-Width' constraint?

查看:220
本文介绍了什么是“UIView的封装,布局宽度”的约束?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不断收到无法同时满足约束条件例外(X code 5,iOS的7,器件和模拟器),凡在列表中的制约因素之一是这样的:

I keep getting 'Unable to simultaneously satisfy constraints' exceptions (Xcode 5, iOS 7, both device and simulator), where one of the constraints in the list is something like this:

"<NSLayoutConstraint:0x165b23d0 'UIView-Encapsulated-Layout-Width'
H:[StoryPlayerCell:0x165affc0(0)]>"

我没有设置这个约束自己。它也并不是一个NSAutoresizingMaskLayoutConstraint。
但是,在它从何而来?而且我怎么能摆脱它?

I did not set this constraint myself. It's also not an NSAutoresizingMaskLayoutConstraint. But where does it come from? And how can I get rid of it?

我不知道。
我不能找到有关苹果的文档中'的UIView封装,布局宽度'任何东西。
即使是谷歌搜索返回什么都没有。

I have no idea. And I can't find anything about 'UIView-Encapsulated-Layout-Width' in the Apple documentation. Even the Google search returns nothing at all.

有什么建议?

PS:我使用这种细胞在UICollectionViewFlowLayout的自定义子类UICollectionView。也许封装-布局部分都有事做这件事?

PS: I'm using this cell in a UICollectionView with a custom subclass of UICollectionViewFlowLayout. Maybe the 'Encapsulated-Layout' part has something to do with this?

推荐答案

一个快速和漂亮的修复,是 999 的优先级值分配给具有较高优先级的自定义限制。封装的&放大器;自动生成的约束应与占主导地位比你的约束更高的优先级。

A quick and nice fix, is to assign 999 priority value to the custom constraints with high priority. The encapsulated & auto-generated constraints should dominate with higher priority than your constraints.

http://stackoverflow.com/a/25795758/590010

这篇关于什么是“UIView的封装,布局宽度”的约束?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆