首页 > 其他 > 详细

查看约束优先级的方法

时间:2016-01-29 11:57:57      阅读:223      评论:0      收藏:0      [点我收藏+]
1     for (UIView* subview in self.underView.subviews) {
2         for ( NSLayoutConstraint *constraint in subview.constraints) {
3             NSLog(@"constraint:%@====>%f",constraint,constraint.priority);
4         }
5     }

1>由于在 Xcode autolayout 布局时,在 IB 中查看约束的优先级很费劲,可以通过以上代码打印出来,快速找到高优先级或低优先级的约束.

2>另外,在 IB 中,约束的优先级如果不是1000,约束的长方形框会变成虚线.

查看约束优先级的方法

原文:http://www.cnblogs.com/lz465350/p/5168410.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!