layoutAttributesForElementsInRect: Logging only once for UICollectionViewFlowLayout cache mismatched
来源:互联网 发布:python在线编译器 编辑:程序博客网 时间:2024/05/21 06:41
转自:http://codecloud.net/14916.html
最近使用UICollectionView自定义布局的时候报了个提示,看着特别烦
提示:
2016-07-08 16:26:38.346 YiTong[27847:733016] Logging only once for UICollectionViewFlowLayout cache mismatched frame
2016-07-08 16:26:38.347 YiTong[27847:733016] UICollectionViewFlowLayout has cached frame mismatch for index path <NSIndexPath: 0xc000000003c00016> {length = 2, path = 0 - 30} - cached value: {{5, 1330}, {202, 24}}; expected value: {{26.5, 1330}, {202, 24}}
2016-07-08 16:26:38.347 YiTong[27847:733016] This is likely occurring because the flow layout subclass YTCategoryCollectionViewFlowLayout is modifying attributes returned by UICollectionViewFlowLayout without copying them
之前的代码:
- (NSArray<UICollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(CGRect)rect {
NSArray *attributes = [super layoutAttributesForElementsInRect:rect];
}
看提示最后一句…without copying them
修改后的代码:
- (NSArray<UICollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(CGRect)rect {
NSArray *attributes = [[NSArray alloc] initWithArray:[super layoutAttributesForElementsInRect:rect] copyItems:YES];
}
修改后就不报提示了
1 0
- layoutAttributesForElementsInRect: Logging only once for UICollectionViewFlowLayout cache mismatched
- Logging only once for UICollectionViewFlowLayout cache mismatched frame
- Once-Only Headers
- you only look once
- Sections must only appear once per config file. See the help topic <location> for exception
- UICollectionViewFlowLayOut
- You only look once:YOLO
- once you dive into the logging
- 嵌入式目标检测--Fast YOLO: A Fast You Only Look Once System for Real-time Embedded Object Detection
- common lisp中once-only 宏
- No. 13 - First Character Appearing Only Once
- YOLO:You Only Look Once 论文阅读
- BulkWrite objects may only be executed once
- You Only Look Once论文中文翻译
- Error: Finish can only be called once
- You Only Look Once-论文笔记
- 【目标检测】YOLO: You Only Look Once
- Exception in thread "main" org.hibernate.MappingException: You may only specify a cache for root <cl
- UltraISO 制作Linux USB启动盘
- Photon Server4.0版本入门(一)初识Photon Server 4.0
- FreeRTOS 学习三:任务管理
- response对象
- 7.4 多元回归分析(multiple Regression)应用
- layoutAttributesForElementsInRect: Logging only once for UICollectionViewFlowLayout cache mismatched
- 三级导航菜单的实现
- AngularJS系列之ES6特性(一)
- 回溯法
- 腾讯云 ubuntu服务器mysql安装和外网访问
- 程序并不难
- MySQL 操作总结(二)
- 基于retrofit的网络框架的终极封装(二)-与retrofit的对接与解耦,以及遇到的坑
- 获取当前进程的task_struct指针------current宏