I have a UITableView. I need to have spacing between the cells, so what I did is, that all the cells are sections and the space between is the section footer. Also I have a UISearchBar on top of the table data to search the data. Now there is one little bug.
I click on the SearchBar. When I do not do a search, but just click cancel directly is get weird lines in the main table view. See Picture 1 below.
When I do a search and scroll the search results and then click cancel the bug doesnt appear. When I do a search and do not scroll, but click cancel, the bug does appear.
Anyone has an idea where that might come from?
I tried to do setNeedsDisplay and reloadData when the cancelButton is clicked, but neither worked.
Here is the code for the section footers.
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
return kZellenAbstand;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
UIView* view = [[UIView alloc] init];
view.backgroundColor = [UIColor whiteColor];
return view;
}
Picture 1 http://img338.imageshack.us/img338/4877/iossimulatorbildschirmf.png