2012-02-10 8 views
0

を実施した後、 shouldAutorotateToInterfaceOrientationが呼び出さなっていると私はYESそこに戻っていますが、それでも私は、デバイスを回転させたときに、コントローラのビューは、そのサイズを変更しますが、メインビュー内のUIImageViewが変わらないサイズは変更されません。そのサイズ。メインビューと同じようにサイズを変更したい事前ビューも私のコードのためにshouldAutorotateToInterfaceOrientation

答えて

2

おかげであなたの必要性に応じてautoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidthを設定します。 コードで

imageview = [[UIImageView alloc] initWithFrame:CGRectMake(40,40,120,100)]; 
imageview.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin; 


あなたはIBで、その後XIBで作成している場合は、以下の画像
enter image description here

+0

これを設定するに示すよう
これを設定? – viewDidAppear

+0

ここでIBまたはコーディングでこれを作成しましたか? –

+0

from code .. imageview = [[UIImageView alloc] initWithFrame:CGRectMake(40,40,120,100)]; – viewDidAppear

関連する問題