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)
        }
    }

 

相关文章:

  • 2021-12-31
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2021-04-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
相关资源
相似解决方案