给tableView设置contentInset的时候如果tableView中内容比较多,超过一个屏幕,设置的contentInset是生效的,但是呢,如果页面内容比较少,我们会发现设置contentInset并不会让内容下移,解决办法是在设置contentInset的同时也要设置contentOffset的内容 eg:

self.tableView.contentInset = UIEdgeInsetsMake(100, 0, 0, 0);
self.tableView.contentOffset = CGPointMake(0,-100);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
  • 2021-11-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-09
  • 2022-12-23
  • 2021-07-15
  • 2022-12-23
  • 2021-07-22
相关资源
相似解决方案