tableview分割线显示不全
2016-03-29 10:07
381 查看
在viewdidload中
if tableview!.respondsToSelector("setSeparatorInset:"){
tableview?.separatorInset = UIEdgeInsetsZero
}
if tableview!.respondsToSelector("setLayoutMargins:"){
tableview?.layoutMargins = UIEdgeInsetsZero
}
重写
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
if cell.respondsToSelector("setLayoutMargins:"){
cell.layoutMargins = UIEdgeInsetsZero
}
if cell.respondsToSelector("setSeparatorInset:"){
cell.separatorInset = UIEdgeInsetsZero
}
}
if tableview!.respondsToSelector("setSeparatorInset:"){
tableview?.separatorInset = UIEdgeInsetsZero
}
if tableview!.respondsToSelector("setLayoutMargins:"){
tableview?.layoutMargins = UIEdgeInsetsZero
}
重写
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
if cell.respondsToSelector("setLayoutMargins:"){
cell.layoutMargins = UIEdgeInsetsZero
}
if cell.respondsToSelector("setSeparatorInset:"){
cell.separatorInset = UIEdgeInsetsZero
}
}
相关文章推荐
- layoutIfneed
- 14条Android Studio常用的的配置
- iOS开发 - 打开文件后进行文件分享(QLPreviewController)
- 一些论文阅读的日常记录
- USB Device Not Found解决办法
- LINQ Query Expressions
- 问题-Delphi2007编译时提示内存错误“sxs.dll. No Debug Info.ACCESS 0xXXXXX"
- Linux中iptables设置详细
- Encountered a duplicated sql alias [name] during auto-discovery of a native-sql
- C语言(浮点精度)
- android 5 设置图案锁,锁屏界面进入相机拍照、查看锁定的照片后,退出锁屏界面再进入相机,不能正常拍照,界面白屏。
- Yii framework 应用小窍门
- (7)文本挖掘(四)——特征选择
- JSP脚本中的9个内置对象
- VK Cup 2016 - Round 1 (Div. 2 Edition) D. Bear and Polynomials
- 《Javascript权威指南》学习笔记之十九--HTML5 DOM新标准---处理文档元信息和管理交互能力
- Ubuntu下设置Eclipse支持GBK和GB2312
- oracle basic sql
- 密码强中弱,短信提示时间按钮
- 【BZOJ3100】排列【杂项】