iPhone - 创建图像网格列表 [英] iPhone - Create an images grid list

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

问题描述

我正在开发一个应用程序,它可以从网站上获取图像,并通过Apple的照片应用程序显示给用户。

I'm developing an application that get images from a website and display to user with a grid view like Photo app by Apple.

当您点击图像时我想推出一个显示图像信息和其他东西的视图控制器。

When you tap on an image I would to push a view controller that displays images info and other stuff.

实现这个的更好的方法是什么?我以为是自定义的UITableViewCell。 (我已经看到有三个和AQGridView库,但我是新手开发者,文档非常差。提示?)

What's the better way to implement this? I thought a custom UITableViewCell. (I've seen there are Three20 and AQGridView libs but I'm a newbie developer and the docs are very very poor. Hints?)

谢谢。

推荐答案

我认为UITableView是最好的方法。它的内存效率高,你只能显示3个图像,所以开销并不是那么糟糕。提示,当您从网站异步获取图像时,创建自定义视图是NSURLRequest的委托,从网页获取数据,使用imageWithData将数据解析为UIImage,并且在调用完成的委托方法时,将imageview放在上面自定义视图的顶部。这是下载异步方法的最佳方法。祝你好运!

I think the UITableView is the best way of doing it. Its memory efficient and your only going to display 3 images anyway so the overhead isn't that bad. A tip, when your asynchronously getting images from the website, create a custom view is a delegate of NSURLRequest, get the data from a webpage, parse the data into a UIImage using imageWithData and when the finished delegate method is called, put a imageview on top of the custom view. This is the best method of downloading asynchronous methods. Good luck!

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

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