zoukankan      html  css  js  c++  java
  • ios7和ios6下Auto Layout still required after executing -layoutSubviews. UITableView's implementation of -layoutSubviews needs to call super.崩溃

    崩溃信息:

    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

     

  • 相关阅读:
    mysql03聚合函数
    栈、队列、循环队列、双端队列、优先级队列04
    OOAD之策略模式(1)
    jvm01:java内存区域与内存
    Python+Selenium
    Python+Selenium
    Python+Selenium
    Python+Selenium
    Python+Selenium
    Python+Selenium
  • 原文地址:https://www.cnblogs.com/xyzaijing/p/4104157.html
Copyright © 2011-2022 走看看