如何在iOS上创建图库 [英] How To Create A Gallery on iOS

查看:87
本文介绍了如何在iOS上创建图库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始为iOS开发一个简单的应用程序,这个应用程序是一个简单的一些照片库(摘自网站)。
我遇到的第一个问题是如何为图库创建视图。

I'm starting to develop a simple application for iOS, and this application is a simple gallery of some photo (taken from a website). The first problem I encountered is how to create the view for the gallery.

视图应该是这样的(或照片应用程序):

The view should be something like this (or the Photo App):

但是要查看此内容方式是有问题的,首先是因为它使用固定维度,我认为有点难以实现(对我而言)。

however doing a view this way is problematic, first because it uses fixed dimension, and I think is a bit difficult to implement (for me).

另一种方法是在内部使用自定义单元格一个tableview,如下所示:

The other way is to use a custom cell within a tableview, like this:

但它仍在使用固定尺寸。

but it is still using fixed dimension.

创建图库的最佳方法是什么,不使用任何第三部分库(如Three20)?

What's the best way to create a gallery, without using any third part lib (like Three20)?

感谢您的回复:)

PS。我认为使用固定尺寸是不好的,因为新的iphone 4(具有不同的分辨率),我是对的吗?

PS. I think that using fixed dimension is bad because of the new iphone 4 (with a different resolution), am I right?

推荐答案

你应该查看 AQGridView ,它完全符合你的目标。即使您想编写自己的自定义代码,也要查看AQGridView源代码,因为您可能需要使用UIScrollView作为基础。

You should check out AQGridView which does exactly what you are trying to achieve. Even if you want to write your own custom code, have a look at the AQGridView source as more than likely you will need to use a UIScrollView as a base.

这篇关于如何在iOS上创建图库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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