UIView debug methods
po view.valueForKey(“_autolayoutTrace”) as! NSString(this will print the view hierarchy from the specified view on down,it will show if there’re any views with an ambiguous layout in the hierarchy)
po label.constraintsAffectingLayoutForAxis(.Horizontal)-it will return an array of all the constraints that are impacting the layout of the specified view in that direction.That’s helpful for narrowing down to only the constraints that impact one view,
po label.hasAmbiguousLayout() -return a simple Boolean indicating if this view is not completely constrained.
expr label.exerciseAmbiguityInLayout() -randomly change the frame of a view to another valid value.This is useful to visualize how the layout is ambiguous.Because it picks a random valid value ,it may not change the layout even if it’s in fact ambiguous…
UIView Debug methods
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- Correctness AdapterViewChildren Summary: AdapterViews can...
- 在彭小六的文章里,看到他推荐了这本书,正好在读时间管理,那就读读吧! 江湖上流传着一个说法:想要系统的学习时间管理...
- 【导读】汽车年检是让车主们最头疼的一件事,尤其是新车主,没有足够的经验,往往吃力不讨好,白忙一趟是在所难免的,百忙...