Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableview background color when using Search Bar

Tags:

iphone

I used searchbar with my UITableview. When I enter search text, the background color will be changed automatically as white color.

and also I used:

tableView.bounces=FALSE;

When I used searchbar, that time bounces also, won't work.

The output like as follows:

alt text

  1. I need to change background color, when I searching content.

  2. I need:

    tableView.bounces=FALSE;

will work, when I searching content.

like image 988
Velmurugan Avatar asked Dec 07 '10 10:12

Velmurugan


1 Answers

Answer for 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;
}
like image 123
Velmurugan Avatar answered Oct 04 '22 22:10

Velmurugan