使用以下代码,范围栏是不可见的(按钮工作但不可见 - 只是黑色空间)
UISearchBar* searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 44 + (_showScope?40:0));];
searchBar.barStyle = UIBarStyleBlack;
searchBar.scopeButtonTitles = [NSArray arrayWithObjects:@"string1", @"string2", nil];
searchBar.showsScopeBar = YES;
searchBar.delegate = self;
self.tableView.tableHeaderView = searchBar;
在 iOS6 中运行良好。有任何想法吗?