热门搜索 :
考研考公
您的当前位置:首页正文

UIView Debug methods

来源:东饰资讯网

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…

Top