Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
UITableView的tableHeaderView或footerView, 或者sectionHeaderView的出现此问题的警告
原因是:限定冲突。
目前发现了3种情况:
- 设置tableHeaderView 和tableFooterView。 且使用了限定。
解决: 为你的header或footer再包一层View。
2.设置table的sectionHeader或footer. 即继承UITableViewHeaderFooterView。
解决: 将继承UITableViewHeaderFooterView的view内的子视图不要直接添加到contentView上,而将所有子视图,都添加到一个容器视图,再将容器加到contentView上。容器不要用限定。 其实和上面那个类似,都是包一层。
3.自定义View中含有scrollView. 然后scrollView中的子视图等,都用frame布局,但是自定义View在其父视图中确是使用限定。此种情况,也会弹限定冲突警告。
网友评论