UITableview background color when using the search bar

I used the search bar with my UITableview. When I enter the search text, the background color will automatically change to white.

and also I used:

tableView.bounces=FALSE; 

When I used the search bar, this time also bounces, will not work.

The output is as follows:

alt text

  • I need to change the background color when searching for content.

  • I need:

    tableView.bounces = FALSE;

will work when I search for content.

+6
iphone
source share
2 answers

Answer my question:

  -(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString { UIImage *patternImage = [UIImage imageNamed:@"1.png"]; [controller.searchResultsTableView setBackgroundColor:[UIColor colorWithPatternImage: patternImage]]; controller.searchResultsTableView.bounces=FALSE; return YES; } 
+16
source share

Set the background color of the cell to clearcolor, and when you reload the table during the search, set the background (table) color to black.

0
source share

All Articles