美文网首页swift问题汇总
【Swift】Swift中tableviewcell分割线显示不

【Swift】Swift中tableviewcell分割线显示不

作者: 简单的美利坚 | 来源:发表于2017-08-28 16:02 被阅读30次

    这些小问题得记录一下,方便后面查找,直接上代码:

    overridefuncviewDidLoad() {

    super.viewDidLoad()

    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

    }

    }

    代理方法中

    functableView(_tableView:UITableView, willDisplay cell:UITableViewCell, forRowAt indexPath:IndexPath) {

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

    cell.layoutMargins = UIEdgeInsets.zero

    }

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

    cell.separatorInset = UIEdgeInsets.zero

    }

    }

    相关文章

      网友评论

        本文标题:【Swift】Swift中tableviewcell分割线显示不

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