iPhone SDK中的网格视图 [英] Grid view in iPhone SDK

查看:83
本文介绍了iPhone SDK中的网格视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的iPhone应用程序中创建一个网格视图,类似于 iPad照片应用程序中显示的网格视图。我知道iPhone 3.2 SDK是在NDA下,但是有一个库或框架可用于添加这种功能(非SDK)。理想情况下,我想最终开发一个iPad版本的应用程序,其中网格将是3个宽的纵向和4个横向,但是目前我想要2个宽的纵向和3个宽的景观。

I would like to create a grid view in my iPhone app similar to that shown in the iPad photos app. I know that the iPhone 3.2 SDK is under NDA, but is there a library or framework available for adding this kind of functionality (non-SDK). Ideally I would like to eventually develop an iPad version of the app, where the grid would be 3 items wide in portrait and 4 in landscape, however for the time being I would like 2 items wide in portrait and 3 wide in landscape.

我能想到这样做的唯一方法是通过继承UITableView并拥有一个创建2或3项的自定义单元格。然而,这似乎很混乱,我相信有更好的方法。

The only way I can think of doing this is by subclassing UITableView and having a custom cell that creates the 2 or 3 items. This however seems messy and I am sure that there is a better way.

一个典型的项目将有一个图片,标签和按钮 - 没有什么太复杂。

A typical item will have a picture, label and button - nothing too complicated.

谢谢

推荐答案

您仍然可以使用UITableView进行此操作你不需要继承它。就像你说的,所有你要做的就是创建自己的自定义单元格,这并不复杂。根本不乱:)

You can still use the UITableView for this and you would not need to subclass it. Like you said all you have to do is create your own custom cell which it is not complicated. Not messy at all :)

这篇关于iPhone SDK中的网格视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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