美文网首页
Swift解决原生TableViewCell分割线缺失问题

Swift解决原生TableViewCell分割线缺失问题

作者: 952625a28d0d | 来源:发表于2016-08-31 20:05 被阅读143次
    func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
            if cell.respondsToSelector(Selector("setSeparatorInset:")) {
                cell.separatorInset = UIEdgeInsetsZero
            }
            if cell.respondsToSelector(Selector("setLayoutMargins:")) {
                cell.layoutMargins = UIEdgeInsetsZero
            }
        }
        
        override func viewDidLayoutSubviews() {
            if self.settingTableView.respondsToSelector(Selector("setSeparatorInset:")) {
                self.settingTableView.separatorInset = UIEdgeInsetsZero
            }
            if self.settingTableView.respondsToSelector(Selector("setLayoutMargins:")) {
                self.settingTableView.layoutMargins = UIEdgeInsetsZero
            }
        }```

    相关文章

      网友评论

          本文标题:Swift解决原生TableViewCell分割线缺失问题

          本文链接:https://www.haomeiwen.com/subject/wvccettx.html