我正在尝试实现一个UIPageController,这样我的用户就可以在图片库上左右滑动。UIImageView将占据整个背景,而标签将位于as的顶部堆叠。下面是我在接口构建器中的尝试:
由于下面的注释,UIImageView的大小检查器:
但是我在界面构建器中遇到了很多错误,如下所示:
2015-09-18 22:19:33.964 ParksonUI[10525:453297] 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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x7aec77f0 V:[_UILayoutGuide:0x7aec7330]-(449)-[UILabel:0x7aec6ca0'Over 200 Tips and Tricks']>",
"<NSLayoutConstraint:0x7aec78b0 V:[UILabel:0x7aec6ca0'Over 200 Tips and Tricks']-(20)-[_UILayoutGuide:0x7aec7440]>",
"<_UILayoutSupportConstraint:0x7aec5ee0 V:[_UILayoutGuide:0x7aec7330(64)]>",
"<_UILayoutSupportConstraint:0x7aec6690 V:|-(0)-[_UILayoutGuide:0x7aec7330] (Names: '|':UIView:0x7aec7270 )>",
"<_UILayoutSupportConstraint:0x7aec6540 V:[_UILayoutGuide:0x7aec7440(0)]>",
"<_UILayoutSupportConstraint:0x7aec7220 _UILayoutGuide:0x7aec7440.bottom == UIView:0x7aec7270.bottom>",
"<NSLayoutConstraint:0x7afea660 'UIView-Encapsulated-Layout-Height' V:[UIView:0x7aec7270(519)]>"
)
我想标签可能被推到图片下面了?
发布于 2015-09-18 10:40:09
首先,一定要像一些研究员提到的那样,在文档大纲中的标签之前有imageView。然后,将imageView调整为主视图的所有边框,并尝试以下约束:
这些贴在标签上:
希望它能成功。
发布于 2015-09-18 06:53:48
你对标签上的顶部和底部都有限制。如果删除顶部约束,则警告将消失。结果将是正确的。您可以添加宽度和高度约束来标记顶部约束。我希望能帮你。
https://stackoverflow.com/questions/32654515
复制相似问题