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

     

  • 相关阅读:
    响应式网页设计初探
    karma 启动提示PhantomJS not found on PATH
    Vuex 拾遗
    cStringIO 实现指定大小的字符串缓存
    javascript 计算文件MD5 浏览器 javascript读取文件内容
    springmvc值传递
    SpringMVC
    spring事务
    spring整合JDBC
    spring-test与junit
  • 原文地址:https://www.cnblogs.com/xyzaijing/p/4104157.html
Copyright © 2011-2022 走看看