崩溃信息:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. UITableView's implementation of -layoutSubviews needs to call super.'

系统:ios6&ios7  (ios8下面没事,不开启autolayout也没事)

 

查了半天,一直以为是自定义的tableview,没有调用super的layoutSubviews方法导致的崩溃,但是看了一圈,控制器里面没有自定义的tableview,而且在ios8下不会崩溃

然后就一点点查,后来发现是因为给tableview指定了backgroundView导致的,看下面的代码_bgImageView是从xib里面拖出来的

 _tableView.backgroundView = _bgImageView;

 

目前不知道导致该问题的根本原因是是什么,只知道是在ios6&ios7上开启autolayout并且给tableview指定的backgroundView是从xib中拖进来view,就会导致该崩溃

 

这里有个demo

http://pan.baidu.com/s/1o6qi65G

 

相关文章:

  • 2022-12-23
  • 2021-07-06
  • 2022-01-17
  • 2021-11-29
  • 2021-07-09
  • 2021-06-07
  • 2021-11-01
  • 2022-02-17
猜你喜欢
  • 2022-12-23
  • 2022-02-14
  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案