美文网首页
TableView 嵌套CollectionView 的高度自适

TableView 嵌套CollectionView 的高度自适

作者: 拉链扣 | 来源:发表于2019-05-30 19:13 被阅读0次

其实iOS 8 以后的高度自适应处理办法 可以 通过设置子视图边界约束去自适应父视图(cell)。

所以实现思路:

1、在cell上设置CollectionView 的边界约束

2、collectionView 加载完数据后更新layout

3、collectionView更新后 tableView就自动更新高度了 神奇吧!!!

demo

相关文章

网友评论

      本文标题:TableView 嵌套CollectionView 的高度自适

      本文链接:https://www.haomeiwen.com/subject/yocbtctx.html