如何在 iphone 水平滚动的滚动视图中加载图像包

How to load bundle of images in a scrollview with horrizondal scrolling in iphone?(如何在 iphone 水平滚动的滚动视图中加载图像包?)

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

问题描述

我有一个 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.

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

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 水平滚动的滚动视图中加载图像包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何在 iphone 水平滚动的滚动视图中加载图像包

基础教程推荐