【发布时间】:2015-03-31 10:34:10
【问题描述】:
我尝试在 iOS7/8 中自定义我的UISearchBar,但遇到了下一个问题:
我的searchDisplayController 背后的背景总是浅灰色。看起来是这样的:
这是我的一些搜索栏自定义代码:
self.searchDisplayController.searchResultsTableView.backgroundColor = UIColorFromRGB(0x171717);
self.searchDisplayController.searchContentsController.view.backgroundColor = UIColorFromRGB(0x171717);
self.searchDisplayController.searchResultsTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.searchDisplayController.searchResultsTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
有什么办法可以解决吗?谢谢。
【问题讨论】:
-
你试过
self.view.backgroundColor或self.searchDisplayController.view.backgroundColor吗? -
self.view.backgroundColor没有帮助,searchDisplayController没有属性view。
标签: ios objective-c uisearchbar uisearchdisplaycontroller