iOS9中的[_UIFlowLayoutSection updateEstimatedSizeForSection]中的UICollectionView崩溃 – Xcode7

iOS9中的[_UIFlowLayoutSection updateEstimatedSizeForSection]中的UICollectionView崩溃 – Xcode7,第1张

概述我尝试使用UICollectionViewCell自动布局. Demo project在iOS8上正常运行但在iOS9上崩溃.我尝试深入调试,但找不到任何理由. Xcode停在[_UIFlowLayoutSection updateEstimatedSizeForSection] 任何的想法? 我刚下载了你的项目.首先转到您的故事板并单击您的标签,在标识符窗格中将标记值更改为100. 在您的cel @H_403_2@ @H_301_6@ 我尝试使用UICollectionVIEwCell自动布局. Demo project在iOS8上正常运行但在iOS9上崩溃.我尝试深入调试,但找不到任何理由. Xcode停在[_UIFlowLayoutSection updateEstimatedSizeforSection]

任何的想法?

解决方法 我刚下载了你的项目.首先转到您的故事板并单击您的标签,在标识符窗格中将标记值更改为100.

在您的cellForItemAtIndexPath函数中替换当前实现

let cell = collectionVIEw.dequeueReusableCellWithReuseIDentifIEr(String("LabelCell"),forIndexPath: indexPath)let str = "dsadasdadaddsfsf"let len = Int(rand()) % str.characters.countlet label = cell.contentVIEw.vIEwWithTag(100) as! UILabel;label.text = str.substringToIndex(str.startIndex.advancedBy(len))cell.setNeedsLayout()cell.layoutIfNeeded()return cell

最后在视图控制器类中注释掉第33行

@H_403_2@ 总结

以上是内存溢出为你收集整理的iOS9中的[_UIFlowLayoutSection updateEstimatedSizeForSection]中的UICollectionView崩溃 – Xcode7全部内容,希望文章能够帮你解决iOS9中的[_UIFlowLayoutSection updateEstimatedSizeForSection]中的UICollectionView崩溃 – Xcode7所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1003753.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-22
下一篇2022-05-22

发表评论

登录后才能评论

评论列表(0条)

    保存