标签:
今天要做一个搜索功能,用到UISearchBar 无奈背景太丑,就自定义了一个,首先用View私有方法打印一下searchBar的层次,
具体修改代码如下
for (UIView *view in _topSerachBar.subviews) { if ([view isKindOfClass:NSClassFromString(@"UIView")] && view.subviews.count > 0) { [[view.subviews objectAtIndex:0] removeFromSuperview]; [[view.subviews objectAtIndex:0] setBackgroundColor:[UIColor redColor]]; [[view.subviews objectAtIndex:1] setTitle:@"自定义"]; break; } } }
(原)iOS 用recursiveDescription打印View
标签:
原文地址:http://www.cnblogs.com/code-changeworld/p/4749163.html