0

I want to add 3 images from 3 URLs in ScrollView so how could I do? Please give me a good tutorial or some explanations!

Sovannarith
  • 614
  • 1
  • 10
  • 20
  • Check my answer here: http://stackoverflow.com/questions/15151721/how-to-load-bundle-of-images-in-a-scrollview-with-horrizondal-scrolling-in-iphon/15155403#15155403 – Petar Mar 15 '13 at 10:12

3 Answers3

1

You can use "AsyncImageView" class files it will load image synchronically.

please refer

https://stackoverflow.com/a/15377082/1713478

in this answer this method call for tableview you can use in for loop and place imageview in scrollview for putting images vertically

int y = 10; 
for (int i = 0; i < (number of images); i++)
{
   UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(X, y, width, height)];

   NSString *imageURL = [NSString stringWithFormat: (image link for i number)];
   AsyncImageView *async = [[AsyncImageView alloc]initWithFrame:CGRectMake(0, 0, width, height)];
   [async loadImageFromURL:[NSURL URLWithString:imageURL]];
  [imageView addSubview:async];
  [scrollView addSubview:imageView];
  y = y+height+10;
}
Community
  • 1
  • 1
Pratik
  • 2,399
  • 17
  • 36
0

You can user PSTCollectionView for gridView kind of display and SDWebImage for lazy loading.

Yashesh
  • 1,799
  • 1
  • 11
  • 29
0

Are you asking how to load remote images OR how to layout them on a scroll view?

1.
UIImage * image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"..."]]];
Wrap it all in dispatch_async or put it in NSOperation to make sure you don't block the main thread.

2.
You can try to use UIPageViewController instead of a UIScrollView

Yariv Nissim
  • 13,273
  • 1
  • 38
  • 44