删除页眉和页脚 [英] Remove Header and Footer

查看:49
本文介绍了删除页眉和页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的UITableView"中删除页眉和页脚我试过了:

I want to remove header and footer from my 'UITableView' I have tried:

table.tableHeaderView = nil;

- (UIView *)tableView:(UITableView *)tableView 
            viewForHeaderInSection:(NSInteger)section{
   return nil;
}

- (CGFloat)tableView:(UITableView *)tableView 
           heightForHeaderInSection:(NSInteger)section{     
    return 0;
}

但是这些都不起作用.

我想从 tableview 开始我的部分.

I want to start my section from starting of tableview.

推荐答案

当我尝试这样做时,通常会得到以下结果:

When I try to do this, what usually ends up working is:

- (UIView *)tableView:(UITableView *)tableView 
            viewForHeaderInSection:(NSInteger)section{
    return [[UIView alloc] initWithFrame:CGRectZero];
}

这篇关于删除页眉和页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆