在自定义的view中使用了[self layoutIfNeeded]方法,在iOS8\9上都没有错误,但是在iOS7上出现了页面错乱,解决方案就是在自定义的view里面添加如下代码:

+ (void)load
{
Method existing = class_getInstanceMethod(self, @selector(layoutSubviews));
Method new = class_getInstanceMethod(self, @selector(_autolayout_replacementLayoutSubviews)); method_exchangeImplementations(existing, new);
} - (void)_autolayout_replacementLayoutSubviews
{
[super layoutSubviews];
[self _autolayout_replacementLayoutSubviews]; // not recursive due to method swizzling
[super layoutSubviews];
}

出现Assertion failure in -[***** layoutSublayersOfLayer:]的更多相关文章

  1. Assertion failure in -[UIView layoutSublayersOfLayer:]

    Assertion failure in -[UIView layoutSublayersOfLayer:], /SourceCache/UIKit/UIKit-2935.137/UIView.m:8 ...

  2. Assertion failure layoutSublayersOfLayer:], /SourceCache

    现象:代码在simulator上能够正常运行但是在真机上出现 Assertion failure in -[UIView layoutSublayersOfLayer:], /SourceCache/ ...

  3. Assertion failure in UITableViewCell layoutSublayersOfLayer解决办法

    iOS6 设备在更新UITableViewCell的时候遇到了 Assertion failure in -[UITableViewCell layoutSublayersOfLayer:], /So ...

  4. Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]

    今天遇到了Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]这个错误,一直也没有百度,不料想却弄了一个 ...

  5. Assertion failure in -[UITableView _classicHeightForRowAtIndexPath:], /SourceCache/UIKit_Sim/UIKit-3318/UITableView.m:10772

    Assertion failure in -[UITableView _classicHeightForRowAtIndexPath:], /SourceCache/UIKit_Sim/UIKit-3 ...

  6. ios AFNetworking 3.0 报错 : *** Assertion failure in -[AFHTTPRequestSerializer requestWithMethod:URLString:parameters:error:],

    AFNetWorking[:] *** Assertion failure -- :::] *** Terminating app due to uncaught exception 'NSInter ...

  7. *** Assertion failure in -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:viewCategory

    报错提示: *** Assertion failure in -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndex ...

  8. iOS Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.30.14/UITableView.m:7962

      Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/Cac ...

  9. 解决:CWnd::SetWindowText报Assertion failure

    参考资料: http://www.cnblogs.com/tiancun/p/3756581.html http://www.tc5u.com/mfc/2120698.htm http://forum ...

随机推荐

  1. andriod终端操作命令

    1.卸载大厅安装包,如果卸载不掉的话,添加-r pm uninstall -r com.scigames.egm.lobby 2.查找包含"scigames"的安装包 3.卸载一个 ...

  2. 如何查看cache信息

    很多时候查不到本机cpu的cache信息.而了解这些信息,对于调优很有帮助 查看1级缓存cache大小 cat /sys/devices/system/cpu/cpu0/cache/index1/si ...

  3. Linux Kernel 3.11 正式版发布

    Linus 发布 了 3.11 版本的 Linux 内核.该版本值得关注的新特性有: Lustre 分布式文件系统.透明的 ARM 架构的大数据页支持:ARM64 上的 Xen 和 KVM 虚拟化:O ...

  4. Orleans中的Timer和Reminder

    Timers and Reminder 定时器和提醒器 Orleans runtime 允许开发人员通过一种叫做timer和另一种叫做reminder的机制为grain添加周期性行为.接下来我分别为大 ...

  5. C语言 串 顺序结构 实现

    一个能够自动扩容的顺序结构的串 ArrString (GCC编译). /** * @brief C语言 串 顺序结构 实现 * @author wid * @date 2013-11-01 * * @ ...

  6. 转:判断DATASET是否为空

    http://blog.sina.com.cn/jiangshuqin2010 1,if(ds == null) 这是判断内存中的数据集是否为空,说明DATASET为空,行和列都不存在!! 2,if( ...

  7. C#笔试题(一)

    一.下面是一个由*号组成的4行倒三角形图案. 要求: 1.输入倒三角形的行数,行数的取值3-21之间,对于非法的行数,要求抛出提示"非法行数!": 2.在屏幕上打印这个指定了行数的 ...

  8. [ACM_搜索] Triangles(POJ1471,简单搜索,注意细节)

    Description It is always very nice to have little brothers or sisters. You can tease them, lock them ...

  9. Linux:用户&用户组操作

    用户:查看用户:whoami.who am i.who mom likes创建用户:adduser dgw切换登录用户:su -l dgw退出当前用户: exit删除用户:deluser dgw -- ...

  10. JavaScript简洁继承机制实现(不使用prototype和new)

    此方法并非笔者原创,笔者只是在前辈的基础上,加以总结,得出一种简洁实用的JavaScript继承方法. 传统的JavaScript继承基于prototype原型链,并且需要使用大量的new操作,代码不 ...