0

ここに画像の説明を入力

UIScrollViewポートレートモードでxibファイルを使用しています。アプリケーションを実行し、デバイスを横向きモードに回転すると、新しい境界が表示されますUIScrollViewUIScrollView下部の内部のコントロールの半分はアクセスできません。スクローラーは表示されません。

UIScrollViewデバイスの向きが変更された後の縦サイズの変更を防ぐ方法は?

ここに画像の説明を入力 ここに画像の説明を入力

助けてくれてありがとう!

4

5 に答える 5

0
 shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
      if(interfaceOrientation == UIInterfaceOrientationPortrait)
    {
         //set frame for scroll in portrait mode
    }
    else  if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft)
    {
      //set frame for landscape
    }

   }
于 2012-10-11T05:49:22.183 に答える
0

編集: UIScrollViewを選択し、このようにスクロールビューのautoresizeプロパティを変更します。

ここに画像の説明を入力してください

 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
 {
     //change sub view of scrollview accordingly to orientation
     if(UIInterfaceOrientationIsPortrait(interfaceOrientation))
         yourScrollView.frame = CGRectMake(0,0,320,460);
         yourScrollView.contentSize = CGSizeMake(320,460);//change accordingly
     else
         yourScrollView.frame = CGRectMake(0,0,480,300);
         yourScrollView.contentSize = CGSizeMake(480,460); //change accordingly

     return YES;
 }
于 2012-10-11T05:52:32.477 に答える
0

UIScrollViewを選択し、プロパティからサイズインスペクターをクリックして、ビューの自動サイズ変更プロパティを変更します。

画像を見る

于 2012-10-11T05:58:30.583 に答える
0
  1. セットアップリファレンスアウトレット
  2. コードを使用します:

    scrollView.contentSize = CGSizeMake(width、height);

于 2012-10-24T15:39:19.303 に答える
0

UIScrollView のフレームを変更します

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;

デバイスの回転に応じて。

于 2012-10-11T05:42:53.733 に答える