首页 > 编程语言 > 详细

swift tableview的分割线不能到头

时间:2015-09-22 18:24:18      阅读:301      评论:0      收藏:0      [点我收藏+]

1,设置tableview的separatorInset, layoutMargins

if(myTableView.respondsToSelector("setSeparatorInset:")) {
            myTableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0)
        }
        if(myTableView.respondsToSelector("setLayoutMargins:")) {
            myTableView.layoutMargins = UIEdgeInsetsMake(0, 0, 0, 0)
        }

2,设置cell的separatorInset, layoutMargins

    func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
        if(cell.respondsToSelector("setSeparatorInset:")) {
            cell.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0)
        }
        if(cell.respondsToSelector("setLayoutMargins:")) {
            cell.layoutMargins = UIEdgeInsetsMake(0, 0, 0, 0)
        }
    }

 

swift tableview的分割线不能到头

原文:http://www.cnblogs.com/shidaying/p/4829516.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!