• 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

     

  • 相关阅读:
    springcloud有哪些特征
    可变参数
    递归
    增强的for循环
    Scanner对象
    注释
    Markdown常见的样式语法
    副本机制
    消费者分区分配策略
    SpringMVC 登陆判断
  • 原文地址:https://www.cnblogs.com/xyzaijing/p/4104157.html
Copyright © 2020-2023  润新知