这个是我的搜索框开始搜索时候,状态栏的颜色怎么不是搜索框的底色,我这里的要求是开始搜索的时候,状态栏的颜色和搜索框的底色要一样,这是为什么,
_discoverTableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
_discoverTableView.separatorStyle = UITableViewCellSelectionStyleNone;
_discoverTableView.backgroundColor = [UIColor whiteColor];
_discoverTableView.delegate = self;
_discoverTableView.dataSource = self;
_discoverTableView.showsVerticalScrollIndicator = NO;
[self.view addSubview:_discoverTableView];
[_discoverTableView makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.view).offset(-NaviBarHeight);
make.left.equalTo(@0);
make.size.mas_equalTo(CGSizeMake(ScreenWidth, ScreenHeight-ViewCtrlTopBarHeight));
}];
self.searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, NaviBarHeight)];
self.searchBar.placeholder = NSLocalizedString(@"search", nil);
self.searchBar.delegate = self;
_discoverTableView.tableHeaderView = self.searchBar;
这是我的代码实现,
self.navigationController.view.backgroundColor = 你searchBar的颜色