如何为 iPad 创建 YouTube 或 eBay 风格的界面?

发布于 2024-10-09 04:19:58 字数 325 浏览 0 评论 0原文

愿意为工作示例授予+500 赏金。

iPad 上的 YouTube 界面非常有趣,是视频网格。 iPad 上的 eBay 有类似的网格界面。

我有兴趣知道这种风格叫什么?是否有任何示例项目可以演示如何实现这一目标,或者编写起来非常简单?

alt 文本

alt text

另外,iPad 上还有哪些其他应用程序具有这种类型的界面?

Willing to award a +500 bounty for a working example.

The YouTube interface for iPad is pretty interesting, the grid of videos. eBay on iPad has a similar type of grid interface.

I am interested in knowing what that style is called? Are there any example projects that demonstrate how to achieve this, or is it pretty simple to write?

alt text

or

alt text

Also, what other apps out there for iPad have this type of interface?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

梦过后 2024-10-16 04:19:58

我在几个项目中使用过 AQGridView 并强烈推荐它。

https://github.com/AlanQuatermain/AQGridView

您需要进行一些子类化才能将其实现做你想做的事,但这是一个好的开始。

I've used AQGridView in a few projects and highly recommend it.

https://github.com/AlanQuatermain/AQGridView

You'll need to do some subclassing to get it to do exactly what you want, but it's a good start.

笑忘罢 2024-10-16 04:19:58

他们很可能只是编写自己的 UIScrollView 子类来显示视图网格。我自己制作了一个,还有其他的开源版本。

编写自己的单元格并不太棘手,具体取决于您是否想要支持重复使用单元格(如果您有很长的列表,您可能会支持)。

此外,这是学习 UIScrollView 的绝佳方式。

您可能对这个感兴趣。

They're most likely just writing their own UIScrollView subclass to show a grid of views. I've made one myself, and there are others available as open source.

It's not too tricky to write your own, depending on whether or not you want to support re-using the cells (and you probably will, if you have long lists).

Also, it's a fantastic way of learning your way around UIScrollView.

You might be interested in this one.

九命猫 2024-10-16 04:19:58

我会以类似于 iPad 文档视图。在那里查看我的答案。也就是说,自然会有一些差异,因为您想要不同的结果。

由于您需要一个网格,因此子类对象将具有较小的框架。此外,图块的 X 和 Y 属性将基于数组中图块的索引。您可能需要一个多维数组来跟踪您的对象,然后使用数组/平铺对象的索引来定位对象。

编辑:

对于网格,创建一个多维数组。假设您有 75 个单元格,并且您需要每行 5 个单元格。因此:

创建一个包含数组的数组(也称为多维数组或 3D 数组)。然后,循环遍历它,如下所示:

for(NSInteger i=0; i<[cells count]; i++){
  for(NSInteger j=0; j < [[cells objectAtIndex:i] count]; j++){
   //lay out cells based on i and j values times height and width of cell
  }
}

I would do this one similarly to the way I would do the iPad document view. See my answer there. That said, naturally, there are some differences, since you want different results.

Since you want a grid, the subclassed object will have a smaller frame. Also, the X and Y properties of the tile will be based on the index of the tile in your array. You might want a multidimensional array to keep track of your objects, and then use the indeces of the array/tile object to position the object.

Edit:

For the grid, make a multidimensional array. Pretend you have 75 cells and that you want rows of five cells each. So:

Make an array containing arrays (also called a multidimensional array or a 3D array). Then, loop through it, like so:

for(NSInteger i=0; i<[cells count]; i++){
  for(NSInteger j=0; j < [[cells objectAtIndex:i] count]; j++){
   //lay out cells based on i and j values times height and width of cell
  }
}
九八野马 2024-10-16 04:19:58

我只使用 UITableViewController。我将使用 UITableCell 的子类来接受视频数组(对于那些只有“加载更多..”单元格的行,该数组可能为零)。行数为视频数除以 4+1。单击“加载更多..”将调用更多数据;刷新数据(例如,添加更多视频)的最简单方法是添加到视频数组并调用刷新表视图。 (抱歉,缺少格式,我正在打电话)这是 Three20 库用于缩略图视图的模式。

希望这有帮助!

I'd just use a UITableViewController. I'd use a subclass of UITableCell that accepts an array of videos (this array could be nil, for those rows that just have the "Load more.." cell). The number of rows would be the number of videos divided by 4+1. Clicking "Load more.." would make a call for more data; the simplest way to refresh the data (eg, add more videos) would be to add to the videos array and make the call to refresh the table view. (sorry for the lack of formatting, I'm on a phone) This is the pattern that the three20 library uses for the thumbnails view.

Hope this helps!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文