如何重新加载 tableviewcell 内的 collectionview [英] how to reload a collectionview that is inside a tableviewcell

查看:18
本文介绍了如何重新加载 tableviewcell 内的 collectionview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 tableViewCell 中有一个 collectionView

I have a collectionView inside a tableViewCell

例如:信用:如何使用 StoryBoard 在 UITableViewCell 内快速构建一个 collectionView

我想在更新信息时重新加载collectionView.

I would like to reload the collectionView when I update information.

我已经在 collectionView 的 cellForItemAtIndexPath 中打印了一个打印件,以测试它是否被调用,但不是.如何让 collectionView 重新加载?

I have put a print in the collectionView's cellForItemAtIndexPath to test if it is being called but it isn't. How can I get the collectionView to reload?

推荐答案

我知道了!在我的 tableViewCell 类中,我只需要将 collectionView 链接为一个出口,所以在我的 tableViewCell 的 cellForRowAtIndexPath 中,我只需要调用 cell.collectionView.reloadData()

I found out how! In my tableViewCell class I just need to link the collectionView as an outlet so in my tableViewCell's cellForRowAtIndexPath I just needed to call cell.collectionView.reloadData()

这篇关于如何重新加载 tableviewcell 内的 collectionview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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