从 UICollectionViewCell 使用 UICollectionView [英] Using a UICollectionView from a UICollectionViewCell

查看:19
本文介绍了从 UICollectionViewCell 使用 UICollectionView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义 UICollectionViewCell,它的内容也是一个集合,我想使用 UICollectionView 来显示它的内容.这可能吗?我将如何做到这一点?我使自定义 UICollectionViewCell 也继承自 UICollectionViewDataSource 并定义了 UICollectionView 内部属性,但事情没有按预期工作.有什么想法吗?

I have a custom UICollectionViewCell whose content is also a collection and I would like to use UICollectionView to display its content. Is this possible? How would I accomplish this? I made the custom UICollectionViewCell also inheriting from UICollectionViewDataSource and define a UICollectionView internal property but things are not working as expected. Any idea?

推荐答案

这是可能的.通常,您将创建一个管理内部集合视图的视图控制器,并将此视图控制器的视图添加到外部集合视图的单元格的内容视图中.

This is possible. Typically you would create a view controller which manages the inner collection view, and add the view of this view controller to the content view of the cell of the outer collection view.

您没有对您当前的尝试或遇到的问题进行任何描述,因此我无法提供更多信息.

You haven't given any description of you current attempts or problems encountered, so I can't offer much more than this.

这篇关于从 UICollectionViewCell 使用 UICollectionView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆