0

I have a UISearchDisplayController that goes black after erasing search-text.

These pictures explain my issue:

Add an a to the searchbar Add an a to the searchbar

Removes the a from the searchbar Removes the a from the searchbar

I tried these settings in ViewDidLoad, but it's not working.

self.searchDisplayController.searchResultsTableView.backgroundColor = [UIColor clearColor];
self.searchDisplayController.searchResultsTableView.backgroundColor = [UIColor clearColor];
Lord Vermillion
  • 5,264
  • 20
  • 69
  • 109

1 Answers1

0

Actually the searchResultsTableView is not shown when the search bar is empty. Instead a semi transparent view is shown so that you can see the underlying view (usually the view of the VC that invokes the search). In your case I guess the underlying view is black so it doesn't matter that the search view is semi transparent :) Setting its background to white color should do the trick.

AXE
  • 8,335
  • 6
  • 25
  • 32