您的位置:首页 > 移动开发 > IOS开发

iOS cell紧贴导航栏

2015-06-30 17:21 441 查看
//确保第一区域紧贴导航栏
- (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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: