0
尝试从集合视图中的图像数组中获取选定图像作为滚动视图中的初始子视图。现在,scrollView从数组中加载第一个图像,而不管在集合视图中点击哪个图像。请提供一些建议或网站,提供有关如何实现此目标的信息。谢谢!在滚动视图中显示初始子视图的所选缩略图
for (int i = 0; i < self.album.count; i++) {
CGRect frame;
frame.origin.x = self.scrollView.frame.size.width * i;
frame.origin.y = 0;
frame.size = self.scrollView.frame.size;
UIImageView *subview = [[UIImageView alloc] initWithFrame:frame];
subview.image = [self.album objectAtIndex:i];
[self.scrollView addSubview:subview];
}
self.scrollView.contentSize = CGSizeMake(self.scrollView.frame.size.width * self.album.count, self.scrollView.frame.size.height);
}