
Question:
Is there any way to determine if a tableview header, not a section header, is visible?
Solution:1
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; }
Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
EmoticonEmoticon