Xcodeは網膜画像を自動的に処理します。
[scrollView setContentSize:imageView.frame.size];
これは、プログラムで、またはxibファイルで画像を設定している場合に機能します。
これはそれを説明するのに役立ついくつかのコードです。.xibファイルにUIScrollViewがあり、.hファイルにscrollviewというIBOutletに接続されていることを前提としています。
// Init the image
UIImage *image = [UIImage imageNamed:@"myImage.png"];
// Init the image view
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
// Position the image view
imageView.frame = CGRectMake(0, 0, imageView.frame.size.width, imageView.frame.size.height);
// Add the image view to your scroll view
[scrollView addSubview:imageView];
// Set the scroll view content size to match the image view size
[scrollView setContentSize:imageView.frame.size];