ios - Uitableview 与 UICollectionviewcell 和 UITableviewcell

标签 ios objective-c iphone uitableview uicollectionviewcell

我需要创建以下设计

enter image description here

我正在按照这段代码在 UITableView 中绘制带有水平滚动的简单 Collection View

当前示例代码是这样工作的

UITableView-> UICollectionViewCell 作为水平滚动的单元格

我想要什么

我想要:第一行带有水平滚动的 UICollectionview 和 然后使用 Normal UITableviewCell 休息行以显示数据

我该怎么做。

最佳答案

  1. UITableView 添加到您的 view controller 并实现它的 delegatedatasource 方法。(您可以使用UITableViewController 而不是 UIViewController)。
  2. 对于 tableviewfirst sectionfist cell,您应该使用 custom tableview cell .
  3. 在这个自定义的 tableview cell 中,您必须添加带有水平滚动collection view,并实现它的delegatedata source 方法在您的自定义 tableview 单元格类中。

这些是您必须执行的步骤。

引用这个implement uicollectionview inside uitableview更多问题。

希望对您有所帮助。

关于ios - Uitableview 与 UICollectionviewcell 和 UITableviewcell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39888747/

相关文章:

ios - MBProgressHud View 自定义在 Swift 3 中不起作用并且不显示?

objective-c - 获取 Mac 操作系统中的文件类型

ios - 单个 ImageView 中的多个触摸事件

ios - 为什么 UILabel 的边框在滚动 tableview 后设置?

iphone - 使用适用于 iOS 的 Facebook SDK 3.0 在 friend 墙上发帖

ios - Axios 不会在 iphone safari 或 chrome 应用程序上发送发布请求

javascript - 修改 DOM 元素的属性

objective-c - didSelectRowAtIndexPath 中的 EXC_BAD_ACCESS

ios - 对 UIViewController 的某些部分启用 UserInteraction

ios - UITextView 像 iOS 邮件应用程序一样增加高度