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

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

问题描述

我在tableViewCell中有一个collectionView

I have a collectionView inside a tableViewCell

例如:

credit:如何使用StoryBoard快速构建UITableViewCell内的collectionView

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

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

我在collectionView的cellForItemAtIndexPath中放置了一个print来测试它是否被调用但是它没有被调用。如何才能让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天全站免登陆