Ios 带有UItableView和UINavigationBar的UISearchBar控制器外观错误

Ios 带有UItableView和UINavigationBar的UISearchBar控制器外观错误,ios,objective-c,uikit,ios9,uisearchbar,Ios,Objective C,Uikit,Ios9,Uisearchbar,我有一个UISearhBarController,它的搜索栏位于uiTableView.tableHeaderView中,它位于带有导航栏的视图中 我正在为搜索栏设置自定义颜色,就像这样 self.searchController.searchBar.searchBarStyle = UISearchBarStyleMinimal; self.searchController.searchBar.backgroundImage = [UIImage imageWithColor:[UIColor

我有一个UISearhBarController,它的搜索栏位于uiTableView.tableHeaderView中,它位于带有导航栏的视图中

我正在为搜索栏设置自定义颜色,就像这样

self.searchController.searchBar.searchBarStyle = UISearchBarStyleMinimal;
self.searchController.searchBar.backgroundImage = [UIImage imageWithColor:[UIColor whiteColor]];
self.searchController.searchBar.backgroundColor = [UIColor whiteColor];
self.searchController.searchBar.translucent = NO;
self.searchController.searchBar.tintColor = [UIColor ACYellowColor];
我更改颜色,使其在导航栏处于活动状态时与导航栏相匹配:

- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar {
[[UITextField appearanceWhenContainedIn:[UISearchBar class], nil] setTextColor:[UIColor whiteColor]];
self.searchController.searchBar.backgroundImage = [UIImage imageWithColor:[UIColor ACBlackColor]];
self.searchController.searchBar.backgroundColor = [UIColor ACBlackColor];
}

- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
    [[UITextField appearanceWhenContainedIn:[UISearchBar class], nil] setTextColor:[UIColor blackColor]];
    self.searchController.searchBar.backgroundImage = [UIImage imageWithColor:[UIColor whiteColor]];
    self.searchController.searchBar.backgroundColor = [UIColor whiteColor];
}
有时,当搜索栏处于活动状态时,在旋转时,它将变为灰色。它似乎只有在过渡到肖像时才这样做,而且只有在iOS 9上才这样做。当我在searchBarTextDidBeginEditing或searchBarCancelButtonClicked中不修改颜色时也会发生这种情况(因此颜色从白色变为灰色)


这里有一个例子说明了这个问题。

结果是范围栏(我没有使用)。 设置它的背景是明确的修复问题

self.searchController.searchBar.scopeBarBackgroundImage = [UIImage imageWithColor:[UIColor clearColor]];

请编辑您的问题,使其实际上是一个问题。现在它看起来更像一个bug报告