Why does using headerReferenceSize with self-sizing cells in a collection view cause a crash in iOS 8?

橙三吉。 提交于 2019-12-04 00:05:16

The best idea I have so far is based on this repository: https://github.com/algal/SelfSizingCellsDemo

On line 50 of ViewController.swift we have label.preferredMaxLayoutWidth = 320 which produces a cell that fills the whole screen and wraps the lines if there is enough text. This would need to be changed to fit whatever size screen you are working with. Then after each section you would need to add enough text to fill that label like is done on line 20 let items = smallitems.componentsSeparatedByString(" ") + [onelongitem]

The problem with this approach is that I don't yet know how I would put different views in that cell, besides text. This might work enough for your situation though.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!