zoukankan      html  css  js  c++  java
  • ios 7 Autolayout bug

    ios 7 Autolayout bug

    错误类型:NSInternalInconsistencyException(SIGABRT)
    详情:Auto Layout still required after executing -layoutSubviews. MttFeedsVideoActionBar's implementation of -layoutSubviews needs to call super.

    根据提示,在使用autolayout的场景下,actionbar的layoutsubview()方法里,需要在[super layoutsubviews()] 调用之前,先调用autolayout的约束方法,所以就这么处理:

    - (void)layoutSubviews
    {
        if([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
            [super layoutSubviews];
        }
        //code needs to be excuted
        [self setLayout];
        if([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
            [super layoutSubviews];
        }
    }
    
  • 相关阅读:
    闭包
    线程与进程
    异常处理
    socket编程
    面向对象编程
    模块
    正则表达式
    递归、二分查找、冒泡算法
    装饰器
    迭代器与生成器
  • 原文地址:https://www.cnblogs.com/lucky-star-star/p/7239179.html
Copyright © 2011-2022 走看看