以下是自定义searchBar
中嵌入的navigationBar
的代码。我为tintColor
和navigationBar
设置了相同的searchBar
。看来tabbar的色调颜色和导航条色调颜色有些不同。可能是什么问题?
- (void)viewdidLoad:(BOOL)animated
{
//Change the navigation bar color
[self.navigationController.navigationBar setBarTintColor:kAppNavigationItemGrayColor];
//Create a UISearchBar
UISearchBar *topBarSearchBar = [[UISearchBar alloc] init];
[topBarSearchBar setBarTintColor:kAppNavigationItemGrayColor];
//Wrapper view to hold searchbar
UIView *searchBarWrapper = [[UIView alloc]initWithFrame:CGRectMake(0.0, 0.0, 310.0, 44.0)];
[topBarSearchBar setFrame:CGRectMake(0.0, 0.0, 310.0, 44.0)];
[searchBarWrapper setBackgroundColor:[UIColor clearColor]];
[searchBarWrapper addSubview:self.topBarSearchBar];
[self.navigationItem setTitleView:searchBarWrapper];
self.navigationItem.hidesBackButton = YES;
}
答案 0 :(得分:0)
试试这个todoTable
答案 1 :(得分:0)
尝试设置,
self.navigationController.navigationBar.translucent = NO;