|
|
|
Array of Images display in UIScrollview and zooming successfully but cannot go next image |
|
|
|
|
|
|
|
Array of Images display in UIScrollview and zooming successfully but cannot go next image
Code (Objective-C)
#define IMAGE_WIDTH 320
#define IMAGE_HEIGHT 540
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
NSArray *photos = [[NSArray arrayWithObjects:
[UIImage imageNamed:@"1.png"],
[UIImage imageNamed:@"2.png"],
[UIImage imageNamed:@"3.png"],
[UIImage imageNamed:@"4.png"],
nil] retain];
// note that the view contains a UIScrollView in aScrollView
int i = 0;
//UIScrollView *scrollView = nil;
for ( NSString *image in photos )
{
NSLog(@"image: %@",image);
UIImage *images = [photos objectAtIndex:i];
imageView = [[UIImageView alloc] initWithImage:images];
imageView.contentMode = UIViewContentModeScaleAspectFit;
imageView.clipsToBounds = YES;
imageView.tag = 1;
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake( IMAGE_WIDTH * i++, 0, IMAGE_WIDTH, IMAGE_HEIGHT)];
scrollView.delegate = self;
scrollView.maximumZoomScale = 3.0f;
imageView.frame = scrollView.bounds;
[scrollView addSubview:imageView];
[imageView release];
NSLog(@"imageview: %@",imageView);
[self.scrollViewimages addSubview:scrollView];
}
}
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
return [scrollView viewWithTag:1];
}
Tag : Mobile, iOS, iPhone, Objective-C
|
|
|
|
|
|
Date :
2015-06-04 11:39:57 |
By :
vishwa |
View :
1183 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|