在自定义表视图单元格中嵌入集合视图 [英] Embed Collection View in Custom Table View Cell

查看:140
本文介绍了在自定义表视图单元格中嵌入集合视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表视图与自定义单元格,它从数组中获取内容,这一切都很好。我想向这个内容添加一个集合视图缩略图的不同数量的每个自定义表视图单元格。

I have a table view with a custom Cell which gets it contents from an array, this all builds fine. I want to add to this content a Collection View of thumb nail images of varying number to each of the custom Table View Cells.

我已将该集合添加到自定义单元格在故事板。
我已经链接到自定义单元格的集合(不确定应该去那里)。
我创建了一个集合自定义单元格并链接图像。

I have added the Collection to the Custom Cell in the Story Board. I have linked the Collection to the Custom Cell.m (not sure it should go there). I have created a Collection Custom Cell and linked the image in.

这是从这里我不知道,如果建立集合视图的方法放置在自定义表Cell.m中或在View Controller.m中?我有一个图像从故事板,你可以看到自定义表单元格,然后(不那么清楚)在底部是一个集合视图(水平滚动),我想填充图像 - 只是不知道如何?我也不确定什么信息可能有帮助,所以对不起,如果有信息缺失。

It is from here I am not sure, should the methods for building the collection view be placed in the the Custom Table Cell.m OR in the View Controller.m? I have an image from the Story Board, you can see the custom table cell and then (not so clear) at the bottom is a Collection View (horizontal scrolling) which I want to populate with images - just not sure how? I am also unsure what info may help so i am sorry if there is info missing.

推荐答案

您应该将 Delagate UITableViewCell 中的 UICollectionView 中的 code> class。

You should put the Delagate and DataSource of the UICollectionView inside the custom UITableViewCell class.

这里是

Here is a nice tutorial.

好运!

这篇关于在自定义表视图单元格中嵌入集合视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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