【问题标题】:Creating Image Grid using UITableView in ios在 ios 中使用 UITableView 创建图像网格
【发布时间】:2012-03-05 04:53:19
【问题描述】:

这里我需要网格布局来创建类似于相册页面,但是在那个页面中我有数千张图片,所以我使用的是 uitableview

【问题讨论】:

标签: iphone objective-c ios uitableview


【解决方案1】:

GridView 可以使用UITableView 完成。您可以做到的一种方法是拥有一个自定义 UITableViewCell 并拥有 2 个带有标签 1 和 2 的 imageView。这样,当您在 cellForRowIndex... 中访问该视图时,您可以提取该 imageView 并填充...

你可以这样做,或者你可以使用其他人已经做过的 -

how to design and create a GridView using UIScrollView or UITableView

How To Create A Gallery on iOS

https://stackoverflow.com/questions/6430012/ios-grid-view-with-section-headers

【讨论】:

    【解决方案2】:

    创建一个扩展 UITableViewCell 的自定义单元格。

    将 UIImageView 添加到它。在- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath上分配图像

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-27
      相关资源
      最近更新 更多