标签:uisearchdisplaycontr tableview 遮挡
代码如下
- (void)viewDidLoad { [super viewDidLoad]; UISearchBar * searchBar =[[UISearchBar alloc]initWithFrame:CGRectMake(0, 0, 320, 44)]; self.tableView.tableHeaderView=searchBar; self.searchController =[[UISearchDisplayController alloc]initWithSearchBar:searchBar contentsController:self]; // //(refreshing) // [self.tableView setContentInset:UIEdgeInsetsMake(128, 0, 0, 0)]; }
问题:searchBar的视图中clipsToBounds 为yes
解决方法:自定义searchbar,重写layoutSubviews方法,把searchbar的所有subview的clipsToBounds重置为no
-(void)layoutSubviews{ [super layoutSubviews]; for (UIView * view in self.subviews) { view.clipsToBounds=NO; } }
uisearchDisplayController放在tableview里下拉刷新状态出现遮挡
标签:uisearchdisplaycontr tableview 遮挡
原文地址:http://blog.csdn.net/yangzhen19900701/article/details/43764545