Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UIScrollView with UIImageView Portrait to Landscape
- scrollGalery = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 40, screenWidth, screenHeight-40)];
- scrollGalery.contentSize = CGSizeMake(4000, self.scrollGalery.frame.size.height);
- scrollGalery.pagingEnabled = YES;
- scrollGalery.backgroundColor = [UIColor clearColor];
- scrollGalery.showsHorizontalScrollIndicator = NO;
- scrollGalery.showsVerticalScrollIndicator = NO;
- scrollGalery.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight);
- scrollGalery.contentMode = UIViewContentModeScaleAspectFit;
- scrollGalery.autoresizesSubviews = YES;
- scrollGalery.delegate = self;
- [view addSubview:self.scrollGalery];
- for (Illustration * illustration in listeIllustrations)
- {
- NSString * labelIllustration = [NSString stringWithFormat:@"%@", illustration.label];
- NSString * urlIllustration = [NSString stringWithFormat:@"%@", illustration.url];
- labelU.text = labelIllustration;
- imageViewSV = [[UIImageView alloc] initWithFrame:CGRectMake(x, 20, scrollGalery.frame.size.width,scrollGalery.frame.size.height-80)];
- imageViewSV.backgroundColor = [UIColor clearColor];
- imageViewSV.contentMode = UIViewContentModeScaleAspectFit;
- imageViewSV.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleRightMargin);
- imageViewSV.autoresizesSubviews = YES;
- [[SnSImageViewDownloadImageOperation alloc] initAndEnqueueWith:YES
- andTarget:imageViewSV
- andUrl:urlIllustration
- andTemporaryImage:nil];
- [self.scrollGalery addSubview:imageViewSV];
- UITextView * textView = [[UITextView alloc] initWithFrame:CGRectMake(x+40, 400, screenWidth-80, 60)];
- textView.backgroundColor = [UIColor clearColor];
- textView.textAlignment = UITextAlignmentCenter;
- textView.font = FONT_DEFAULT(12);
- textView.text = illustration.copy;
- textView.editable = NO;
- [self.scrollGalery addSubview:textView];
- x += imageViewSV.frame.size.width;
- }
- self.scrollGalery.contentSize = CGSizeMake(x, screenHeight-navigationBarHeight);
Add Comment
Please, Sign In to add comment