-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self = [[NSBundle mainBundle] loadNibNamed:@"MessageNotificationTableViewCell" owner:nil options:nil][];
// self.contentView.backgroundColor=[UIColor clearColor];
//self.backgroundColor=[UIColor clearColor];
self.selectionStyle=UITableViewCellSelectionStyleNone;
UIView *view = [[UIView alloc ]initWithFrame:CGRectMake(, , SCREEN_WIDTH, )]; view.backgroundColor =MAIN_COLOR_GRAY; [self.contentView addSubview:view]; }
return self;
}

另一种方法

自定义cell,然后重写cell的setFrame方法
-(void)setFrame:(CGRect)frame {
    frame.y += 10;
    [super setFrame:frame];
}

每个cell设置frame时,都给它的y值增加10的位置

调整cell的间距的更多相关文章

  1. ios 设置cell的间距

    1.设置假的间距,我们在tableviewcell的contentView上添加一个view,比如让其距离上下左右的距离都是10:这个方法是最容易想到的: 2.用UIContentView来代替tab ...

  2. android中怎么调整字体的间距和行间距

    在网页中都是很轻松的就可以调整间距的.在android中,我个人并没有去设置过. 下面就来说说android中的间距问题. 原文:http://blog.csdn.net/fancylovejava/ ...

  3. 如何调整cell的大小

    一般情况下,我们使用tableview的时候从来没有设置过cell的大小(w,h).位置(x,y)等,而是系统直接给我们自动生成,但是有的时候我们可能会改动cell的大小及位置,比如:在适配ios6跟 ...

  4. mathType插入公式编号,及对公式编号的字体进行修改。调整公式上下间距。

    一:插入 公式编号. 1:首先设置公式格式.点击 mathtype>insert number >format 2:有简单格式和 高级格式:              https://we ...

  5. UICollectionView设置item(cell)之间间距为0(紧挨在一起的效果)

    UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; self.layout = layout ...

  6. iOS UICollectionView 长按移动cell

    ref:http://www.jianshu.com/p/31d07bf32d62 iOS 9之后: 示例如下 效果 前言: 看完你可以学到哪些呢? 就是文章标题那么多, 只有那么多. . 手残效果图 ...

  7. iOS UICollectionView高级用法(长按自由移动cell)-新

    [reference]http://www.jianshu.com/p/31d07bf32d62 iOS 9之后: 示例如下 效果 前言: 看完你可以学到哪些呢? 就是文章标题那么多, 只有那么多. ...

  8. iOS UICollectionView高级用法(长按自由移动cell)

    iOS 9之后: 示例如下 效果 前言: 看完你可以学到哪些呢? 就是文章标题那么多, 只有那么多. . 手残效果图没弄好. @property (nonatomic, strong) UIColle ...

  9. Css调整字体间距

    在span div 某些元素中有时候会用到调整字体的间距,设置方法: letter-spacing:15px;  

随机推荐

  1. fragment的实现与互相通信

    Android3.0后出来的新控件,主要是为了在平板和手机屏幕的兼容 实现效果: 点击Sd卡,出现SD目录下的所有文件和文件夹,点击外置Sd卡,出现外置Sd卡目录下的文件和文件夹.点击U盘,出现U盘目 ...

  2. 7.4.1 Dumping Data in SQL Format with mysqldump

    7.4 Using mysqldump for Backups 使用mysqldump 用于备份: 7.4.1 Dumping Data in SQL Format with mysqldump 7. ...

  3. pl/sql 在一个程序块里打印日志输出到表格

    declare v_number NUMBER; v_number2 NUMBER; begin execute immediate 'truncate table t2'; insert into ...

  4. Delphi实现AnsiString与WideString的转换函数 转

    Delphi实现AnsiString与WideString的转换函数 分类: Delphi2013-01-26 16:23 460人阅读 评论(0) 收藏 举报 [delphi] view plain ...

  5. Word Ladder——LeetCode

    Given two words (start and end), and a dictionary, find the length of shortest transformation sequen ...

  6. Eucalyptus使用的技术

    libvirt Libvirt 库是一种实现 Linux 虚拟化功能的 Linux® API,它支持各种虚拟机监控程序,包括 Xen 和 KVM,以及 QEMU 和用于其他操作系统的一些虚拟产品. N ...

  7. 男装电商Bonobos融资5500万美元,计划IPO,全靠体验店战略 - 国外 - 快鲤鱼

    男装电商Bonobos融资5500万美元,计划IPO,全靠体验店战略 - 国外 - 快鲤鱼 男装电商Bonobos融资5500万美元,计划IPO,全靠体验店战略

  8. Spice代码阅读一:Spice Client 与 Spice Server 通道建立过程

    文件 方法 描述 Application.cpp init_globals() 初始化Log,ssl库,canvas(或opengl canvas)和quic压缩库 Process_cmd_line( ...

  9. 【转】非常完善的Log4net详细说明

    转自:http://www.cnblogs.com/zhangchenliang/p/4546352.htmlhttp://www.cnblogs.com/zhangchenliang/p/45463 ...

  10. atol字符串转换函数应用实例

    原型:long atol(const char *nptr); 相关函数 atoi,atol,strtod,strtol,strtoul 头文件:stdlib.h 功能:将字符串转换成整型数 说明:参 ...