码迷,mamicode.com
首页 > 移动开发 > 详细

iOS cell紧贴导航栏

时间:2015-06-30 18:12:55      阅读:252      评论:0      收藏:0      [点我收藏+]

标签:

//确保第一区域紧贴导航栏
- (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;
}

iOS cell紧贴导航栏

标签:

原文地址:http://www.cnblogs.com/tongyuling/p/4611105.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!