此方法兼容ios 7.8.9

    // 在tableView创建地方设置

   if tableView!.respondsToSelector("setSeparatorInset:"){

            tableView!.separatorInset = UIEdgeInsetsZero

        }

        if tableView!.respondsToSelector("setLayoutMargins:"){

            tableView!.layoutMargins = UIEdgeInsetsZero

        }

        self.tableView!.tableFooterView = UIView()  //去除空白的cell

  //在cell重用的方法里

        if cell.respondsToSelector("setSeparatorInset:"){

            cell.separatorInset = UIEdgeInsetsZero

        }

        

        if cell.respondsToSelector("setLayoutMargins:"){

            cell.layoutMargins = UIEdgeInsetsZero

        }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 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-07-15
  • 2021-11-08
相关资源
相似解决方案