UITableView的headerView和headerInsectionView

UITableView有两个headerView:tableHeaderView、和headerInsectionView(组头视图)。
 
给tableView添加这两个View:tableHeaderView是通过tableView.tableHeaderView = XXXView 的方式添加的,而headerInsectionView是通过

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section代理方法添加的。

 

UITableView的Style为Plain时,当tableView上移顶端的tableHeaderView会跟着滑出窗口,而headerInsectionView则会悬浮固定在窗口顶端不随着滑动继续上移。
UITableView的Style为Grouped时,当tableView上移顶端的tableHeaderView会跟着滑出窗口,而headerInsectionView则会随着滑动继续上移。

猜你喜欢

转载自www.cnblogs.com/r360/p/9145491.html
今日推荐