【发布时间】:2014-07-18 14:22:52
【问题描述】:
我有 url。现在我可以获取 Url 的图像。但是现在我需要将 8 张图像传递给 ScrollView。所以请告诉我有关我的问题的任何想法。 我试过这样:-
NSMutableArray *al=[NSJSONSerialization JSONObjectWithData:webData options:0 error:nil];
for (NSDictionary *diction in al)
{
NSString *geting =[diction valueForKey:@"dealimage"];
NSLog(@"dealimage is %@",geting);
NSData *getdata=[[NSData alloc]initWithData:[NSData dataFromBase64String:geting]];
NSLog(@"good day %@",getdata);
dataimages=[UIImage imageWithData:getdata];
NSLog(@"dataimages %@",dataimages);
[imagesarray addObject:dataimages];
}
当我打印图像数组时它正在显示
images array is array(
"<UIImage: 0x7539b70>",
"<UIImage: 0x7176e00>",
"<UIImage: 0x7182960>",
"<UIImage: 0x7185d40>",
"<UIImage: 0x7541d00>",
"<UIImage: 0x7186e30>",
"<UIImage: 0x7186ff0>",
"<UIImage: 0x7187410>"
)
示例:- 请告诉我如何在获取图像时添加滚动。 感谢高级。
【问题讨论】:
-
使用集合视图。
-
@duci9y 谢谢,但我需要滚动图像,所以请告诉我有关如何滚动图像 CollectionView 的任何想法。当我在 CollectionView 单元格上传递图像时仅显示
-
集合视图是滚动视图。它滚动。
标签: ios objective-c json uiscrollview uiimageview