如何在iphone中使用horrizondal滚动滚动视图中加载图像包? [英] How to load bundle of images in a scrollview with horrizondal scrolling in iphone?

查看:77
本文介绍了如何在iphone中使用horrizondal滚动滚动视图中加载图像包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个iPhone应用程序,我需要加载大量的图像(即大约50个),它有一个小的矩形(略高于缩略图),每行包含3个,每页有4列,我需要水平滚动以加载下12个图像,依此类推。此外,我需要将其下的页码显示为1,2等。

I have an iPhone application in which i need to load a bulk of images (ie around 50),which has a small rect like (little above thumbnail) containing 3 in each row with 4 columns in one page, and i need to scroll horizontally to load the next 12 images and so on. Also i need to show the page number under it as 1,2 etc.

任何人都可以指导我在正确的方向上实现这一点吗?我真的很乱,如何将imageview添加到这样的滚动视图中,每个图像视图都有它也有自己的按钮。

Can any body guide me in the right direction to achieve this in a scroll view ?i am really in a mess ,how to add imageview to a scrollview like this ,also each image view has its own buttons also.

推荐答案

使用UItableview在其上创建带有两个图像视图的自定义单元格,然后将该自定义单元格加载到单元格用于索引路径创建一个nsarray并将图像名称传递给该数组,然后将该图像转换为数据格式,例如

Use UItableview create custom cell with two imageviews on it and load that custom cell to cell for indexpath then create an nsarray and pass the image names into that array and then convert that image into data format for eg

nsdata * data = [NSdata dataWithcontents of url [array object at index] :indexpath.row]];
cell.imageview.image = [uiimage imagewithdata:data];
为此您应该知道创建自定义单元格。

nsdata *data = [NSdata dataWithcontents of url [array object at index:indexpath.row]]; cell.imageview.image = [uiimage imagewithdata:data]; for this you should know to create custom cells.

这篇关于如何在iphone中使用horrizondal滚动滚动视图中加载图像包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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