0
私はフルスクリーンスクロールビューを持っています。私はそれに2つの画像をロードしています。風景モードではうまく動作しますが、ポートレートモードでは画像が画面より大きくなるため、一部の画像しか見ることができません。それはself.view.boundsはクイックフィックスと、右の画面サイズself.view.boundsがポートレートで表示されない
CGRect frameForView1 = self.view.bounds;
CGRect frameForView2 = self.view.bounds;
image1 = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:fullpath]];
[image1 setFrame:frameForView1];
[self.scrollView addSubview:image1];
[image1 release];
frameForView2.origin.x = frameForView2.size.width;
image2 = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:fullpath]];
[image2 setFrame:frameForView2];
[self.scrollView addSubview:image2];
[image2 release];
self.scrollView.contentSize = CGSizeMake(self.scrollView.frame.size.width * 2, self.scrollView.frame.size.height);
'[UIScreen mainScreen] .bounds'はローテーションでは変更されませんが、ビューコントローラのビューの境界は変更されます。 (デフォルトの動作、すなわち標準の自動サイズ変更マスクを仮定して) – NJones