UITableViewCell 分割线如何满屏
2024-08-31 00:06:27
在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]; } }
最新文章
- C++基础——函数指针 函数指针数组
- 【背景建模】SACON
- 数据结构算法C语言实现(二)---2.3线性表的链式表示和实现之单链表
- ASP.NET MVC Json()处理大数据异常解决方法,字符串的长度超过了为 maxJsonLength
- Hadoop 2.4.1 设置问题小结【原创】
- BZOJ 4551 树
- Educational Codeforces Round 7 D. Optimal Number Permutation 构造题
- spring集成mongodb jar包版本问题
- SVN权限配置
- input子系统 KeyPad-Touch上报数据格式与机制【转】
- MySQL的sql_mode模式说明及设置
- Laravel上传产品图片Uploading img
- linux中WDCP的日志彻底删除技巧
- (网络流) Sabotage -- UVA -- 10480
- 点击搜索条件提交form表单
- python抓包模块
- jQuery Datatable 转载
- 修改数据库中的内容报错:PropertyAccessException:Null value was assinged to a property of primitive type setter of
- golang rest api example
- C# 组装XML传给webserver+XML 返回获取多个xml,根据多个XML 返回dataset类型
热门文章
- BZOJ1012 [JSOI2008]最大数 线段树
- Nginx+certbot 实现泛域名的https证书
- 三元运算符,i++(先用后加) ++i (先加后用)区别
- 在pycharm中使用指定的虚拟环境virtualenv
- Android 简单适配器(SimpleAdapter)
- P2257 YY的GCD (莫比乌斯反演)
- [转] 如何在ie11里使用a连接创建动态下载文件流
- pyquery的简单操作
- centos7.3下安装redis3.2 yum安装
- oracle 备份恢复篇(一)---rman