我正在使用UIRefreshControl和UISearchBar当我拉动刷新时,我看到uiviewcontroller顶部的白色背景
UISearchBar *searchBar =
[[UISearchBar alloc] initWithFrame:
CGRectMake(0, 0, self.tableView.frame.size.width, 44.0)];
searchBar.autocorrectionType = UITextAutocorrectionTypeNo;
self.tableView.tableHeaderView = searchBar;
_refreshControl = [[UIRefreshControl alloc] init];
[_refreshControl addTarget:self action:@selector(update) forControlEvents:UIControlEventValueChanged];
[self.tableView addSubview:_refreshControl];
问题是上面的白色背景
任何想法?
答案 0 :(得分:5)
为表格创建背景视图并将其颜色设置为clearColor,如此
- (void)viewDidLoad {
self.tableView.backgroundView = [UIView new];
self.tableView.backgroundView.backgroundColor = [UIColor clearColor];
}