Cell 其他用法

  1. 空隙
- (void)setFrame:(CGRect)frame

{
    
    frame.size.height -= 10;
    
    [super setFrame:frame];
    
}
  1. headview 间隔
- (CGFloat)tableView:(UITableView*)tableView heightForHeaderInSection:(NSInteger)section{
    if(section == 0) {
    return 20;//设置headerview与第一个cel之间的距离l


      }
    return 1;


}

- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section {
    if ([view isKindOfClass:[UITableViewHeaderFooterView class]]) {
        ((UITableViewHeaderFooterView *)view).backgroundView.backgroundColor = [UIColor clearColor];
    }
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 一、简介 <<UITableView(或简单地说,表视图)的一个实例是用于显示和编辑分层列出的信息的一种手段 <<...
    无邪8阅读 10,706评论 3 3
  • 版权声明:未经本人允许,禁止转载. 1. TableView初始化 1.UITableView有两种风格:UITa...
    萧雪痕阅读 2,920评论 2 10
  • UIView+SGFrame.h #import @interface UIView (SGFrame) @pro...
    超越时空的思念_8a22阅读 1,854评论 1 1
  • UITableView有两种样式: UITableView的结构:UITableView由头部,尾部,和中间一连串...
    degulade阅读 848评论 1 3
  • UITableView 表格视图一 UITableView1.1是什么?以列表的方式展示数据的一种控件,且继承自...
    037e3257fa3b阅读 262评论 0 1