1

画像のURLを知っている画像をダウンロードしています。クイックルックフレームワークを使用してこの画像を表示するにはどうすればよいですか。次のコードを使用してダウンロードしています。

UIImage *image = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL  
URLWithString:@"http://good-wallpapers.com/pictures/3048/frosty_apple_logo_iphone.jpg"]]];

賢明なようにUIImagesの配列または辞書がある場合、quickLookに何をすべきですか..

4

1 に答える 1

2

スクロール ビューの UIimageview は、すべての画像を表示するのに適しています。以下は、配列からUIscrollviewのUIimageViewにすべての画像をロードしています

for (UIView *v in [scrollView subviews]) {
    [v removeFromSuperview];
}

CGRect workingFrame = scrollView.frame;
workingFrame.origin.x = 0;

for(id datavalue in tableList) {

    UIImage *downloadedImage = [UIImage imageWithData:datavalue];
    imageview = [[UIImageView alloc] initWithImage:downloadedImage];
    [imageview.layer setBorderColor: [[UIColor grayColor] CGColor]];
    [imageview.layer setBorderWidth: 2.0];
    [imageview setContentMode:UIViewContentModeScaleAspectFit];
    imageview.frame = workingFrame;
    [scrollView addSubview:imageview];
    [imageview release];

    workingFrame.origin.x = workingFrame.origin.x + workingFrame.size.width;
}

[scrollView setPagingEnabled:YES];
[scrollView setContentSize:CGSizeMake(workingFrame.origin.x, workingFrame.size.height)];

ここで、tablelist は画像データのコレクションです。

于 2012-06-22T09:48:01.613 に答える