Is there any way to determine if a tableview header, not a section header, is visible?
A:
This works
-(BOOL)tableHeaderVisible:(UITableView *)tableView { CGRect headerRect = tableView.tableHeaderView.frame; CGRect visibleRect; visibleRect.origin = tableView.contentOffset; visibleRect.size = tableView.contentSize; if(visibleRect.origin.x >= (headerRect.origin.x + headerRect.size.width)) { return NO; } if(visibleRect.origin.y >= (headerRect.origin.y + headerRect.size.height)) { return NO; } if(headerRect.origin.x >= (visibleRect.origin.x + visibleRect.size.width)) { return NO; } if(headerRect.origin.y >= (visibleRect.origin.y + visibleRect.size.height)) { return NO; } return YES; }
Jim B
2010-08-10 23:07:34