How to load bundle of images in a scrollview with horrizondal scrolling in 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 水平滚动的滚动视图中加载图像包


- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- Android - 拆分 Drawable 2022-01-01