这是问题代码:
代码是显示一个图像数组,然后可以滚动浏览.
- (void)viewDidLoad {
[super viewDidLoad];
NSArray *photos = [[NSArray arrayWithObjects:
[UIImage imageNamed:@"Event.png"],
[UIImage imageNamed:@"Logo.png"],
[UIImage imageNamed:@"default.png"],
[UIImage imageNamed:@"LittleLogoImage.png"],
nil] retain]; // TODO – fill with your photos
// note that the view contains a UIScrollView in aScrollView
int i=0;
int width = 0;
int height = 0;
for ( NSString *image in photos )
{
UIImage *image = [UIImage imageNamed:[photos objectAtIndex:i]];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
imageView.contentMode = UIViewContentModeScaleAspectFit;
imageView.clipsToBounds = YES;
imageView.frame = CGRectMake( imageView.frame.size.width * …Run Code Online (Sandbox Code Playgroud)