Swift tableview 单元格分割线显示不全的解决方法
2015-08-30 19:50
711 查看
今天写代码初次遇到这个问题:
查阅了资料后解决方法如下:
在viewdidload()中加入下面代码:
然后重写方法:
问题解决:
查阅了资料后解决方法如下:
在viewdidload()中加入下面代码:
if aboutTable.respondsToSelector("setSeparatorInset:"){ aboutTable.separatorInset = UIEdgeInsetsZero } if aboutTable.respondsToSelector("setLayoutMargins:"){ aboutTable.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 } }
问题解决:
相关文章推荐
- Swift入门篇-闭包和函数
- swift入门篇-函数
- Swift入门篇-集合
- Swift入门篇-循环语句
- Swift入门篇-字符串和字符
- Swift入门篇-基本类型(3)
- Swift入门篇-基本类型(2)
- Swift入门篇-基本类型(1)
- Swift入门篇-Hello World
- Swift入门篇-swift简介
- Swift下创建和引用pch文件
- Swift UIView 层次调整
- Swift - 基本运算符
- Swift UIView 常用添加方法
- swift 新特性
- swift详解之十七-----------GCD的一些高级用法
- swift 物理仿真行为
- 读懂Swift 2.0中字符串设计思路的改变
- Swift 2.0初探:值得注意的新特性
- Swift中使用MPMoviePlayerController实现自定义视频播放器界面