UITableView的Group样式下顶部空白处理
在viewWillAppear里面添加如下代码:
//分组列表头部空白处理
CGRect frame = myTableView.tableHeaderView.frame;
frame.size.height = 0.1; UIView *headerView = [[UIView alloc] initWithFrame:frame]; [myTableView setTableHeaderView:headerView];
UITableView的plain样式下,取消区头停滞效果
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGFloat sectionHeaderHeight = sectionHead.height;
if (scrollView.contentOffset.y<=sectionHeaderHeight&&scrollView;.contentOffset.y>=0)
{
scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0); } else if(scrollView.contentOffset.y>=sectionHeaderHeight) { scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0); } }