首页 > 移动平台 > 详细

iOS cell紧贴导航栏

时间:2015-06-30 18:11:10      阅读:226      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!