有时候在写代码布局UI的时候不好调节Ui的位置,可以用不同的颜色标记出各个view,特别是神马都不显示的时候特别有用。
- (void)markBorderWithRandomColor{
self.layer.borderColor = RGBCOLOR(arc4random() % 255,
arc4random() % 255,
arc4random() % 255).CGColor;
self.layer.borderWidth = 1.0f;
}
- (void)markBorderWithRandomColorRecursive{
[self markBorderWithRandomColor];
for (UIView *v in self.subviews) {
[v markBorderWithRandomColorRecursive];
}
}