场景:

当 ​​UITableView​​​ 的 ​​style​​​ 属性设置为 ​​Plain​​​ 时
​​​tableview​​​ 的 ​​section header​​​ 在滚动到界面顶端时
会 ​​​悬停​​ !


疑问:

1.如何在不使用​​Grouped​​​时,让组头不悬停??
2.如何在不重写​​​-scrollViewDidScroll:​​​ (​​示例​​) 方法时,让组头不悬停???


办法:

1.针对没有内容的 ​​section header​​​
直接设置 ​​​header view​​​ 的背景颜色为 ​​clearColor​​​
设置 ​​​tableview​​​ 的背景颜色为 ​​section header​​ 的背景颜色

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
UIView *view = [[UIView alloc] init];
view.frame = CGRectMake(0, 0, kScreenWidth, 10);
view.backgroundColor = [UIColor clearColor];
return

2.针对有内容的 ​​section header​​​
- 使用 ​​​Grouped​​​
- 参考 ​​​示例​