【发布时间】:2014-03-16 02:24:32
【问题描述】:
我有一个UIPageViewController 子类,我想在它的viewDidLoad 中添加一个UILabel 到它的self.view。如果我使用框架设置它的位置,这工作正常,但如果我尝试使用自动布局定位它,我得到:
* -[_UIPageViewControllerContentView layoutSublayersOfLayer:] 中的断言失败,/SourceCache/UIKit_Sim/UIKit-2935.58/UIView.m:8742
我应该如何定位此 UILabel 以显示在 UIPageViewController 中?
【问题讨论】:
-
假设断言是因为约束冲突,你还记得 translatesAutoresizingMaskIntoConstraints = NO 吗?
-
是的,我确实记得。
-
您是否也收到消息“执行 -layoutSubviews 后仍需要自动布局”?
标签: ios objective-c uiview autolayout uipageviewcontroller