Swift解决原生TableViewCell分割线缺失问题
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
网友评论