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);
}