直接取消悬停的方法我还没研究过,不过可以做类似效果。
1.将分组header设置为clearColor。只要header不是很高并且涉及点击等事件,可用此方法代替
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 12;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIView *view = [[UIView alloc] init];
view.backgroundColor = [UIColor clearColor];
return view;
}
2.用cell代替header。即只分一个组,在特定位置处理cell。
eg:有2个组,每组有3条数据。
1) tabelView分1个组,8个cell。
2)在indexPath.row == 0 和 indexPath == 3的时候作为header单独处理cell.