在iOS7中,UITableViewCell左侧会有默认15像素的空白。设置setSeparatorInset:UIEdgeInsetsZero 能将空白去掉。

但是在iOS8中,设置setSeparatorInset:UIEdgeInsetsZero 已经不起作用了。下面是解决办法

在UITableView的代理方法中加入以下代码

 - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath

 {

     if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {

         [cell setSeparatorInset:UIEdgeInsetsZero];

     }

     if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {

         [cell setLayoutMargins:UIEdgeInsetsZero];

     }

 }    

最新文章

  1. C++基础——函数指针 函数指针数组
  2. 【背景建模】SACON
  3. 数据结构算法C语言实现(二)---2.3线性表的链式表示和实现之单链表
  4. ASP.NET MVC Json()处理大数据异常解决方法,字符串的长度超过了为 maxJsonLength
  5. Hadoop 2.4.1 设置问题小结【原创】
  6. BZOJ 4551 树
  7. Educational Codeforces Round 7 D. Optimal Number Permutation 构造题
  8. spring集成mongodb jar包版本问题
  9. SVN权限配置
  10. input子系统 KeyPad-Touch上报数据格式与机制【转】
  11. MySQL的sql_mode模式说明及设置
  12. Laravel上传产品图片Uploading img
  13. linux中WDCP的日志彻底删除技巧
  14. (网络流) Sabotage -- UVA -- 10480
  15. 点击搜索条件提交form表单
  16. python抓包模块
  17. jQuery Datatable 转载
  18. 修改数据库中的内容报错:PropertyAccessException:Null value was assinged to a property of primitive type setter of
  19. golang rest api example
  20. C# 组装XML传给webserver+XML 返回获取多个xml,根据多个XML 返回dataset类型

热门文章

  1. BZOJ1012 [JSOI2008]最大数 线段树
  2. Nginx+certbot 实现泛域名的https证书
  3. 三元运算符,i++(先用后加) ++i (先加后用)区别
  4. 在pycharm中使用指定的虚拟环境virtualenv
  5. Android 简单适配器(SimpleAdapter)
  6. P2257 YY的GCD (莫比乌斯反演)
  7. [转] 如何在ie11里使用a连接创建动态下载文件流
  8. pyquery的简单操作
  9. centos7.3下安装redis3.2 yum安装
  10. oracle 备份恢复篇(一)---rman