iOS cell紧贴导航栏
时间:2015-06-30 18:11:10
收藏:0
阅读:227
//确保第一区域紧贴导航栏
- (void)viewWillAppear:(BOOL)animated
{
CGRect frame = _tableView.tableHeaderView.frame;
frame.size.height = 1;
UIView *headerView = [[UIView alloc] initWithFrame:frame];
[_tableView setTableHeaderView:headerView];
}
//section头部间距
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
return 0.01;//section头部高度
}
//section头部视图
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 0)];
view.backgroundColor = [UIColor clearColor];
return view;
}
原文:http://www.cnblogs.com/tongyuling/p/4611105.html
评论(0)