[绍棠_Swift] Swift3.0中tableviewcell分割线显示不全解决方案

来源:互联网 发布:淘宝会员卡封面设置 编辑:程序博客网 时间:2024/06/06 07:14

override func viewDidLoad() {

        super.viewDidLoad()

       // Do any additional setup after loading the view.

        self.view.backgroundColor = UIColor.white

        if (homeTabble?.responds(to:#selector(setter: UITableViewCell.separatorInset)))! {

            homeTabble?.separatorInset = UIEdgeInsets.zero

        }

        if (homeTabble?.responds(to:#selector(setter: UIView.layoutMargins)))! {

            homeTabble?.layoutMargins = UIEdgeInsets.zero

        }

    }


代理方法中


    func tableView(_ tableView:UITableView, willDisplay cell:UITableViewCell, forRowAt indexPath:IndexPath) {

        if cell.responds(to:#selector(setter: UIView.layoutMargins)) {

            cell.layoutMargins = UIEdgeInsets.zero

        }

        if cell.responds(to:#selector(setter: UITableViewCell.separatorInset)) {

            cell.separatorInset = UIEdgeInsets.zero

        }

    }



阅读全文
0 0
原创粉丝点击