0

このコードによってインターフェイスの向きをブロックしました。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;

    if (orientation == UIDeviceOrientationPortrait) {
        NSLog(@"portrait");
    }else{
        NSLog(@"landsape");
     }
        return NO;
     }

ボタンの上方向を指すためにポップオーバーを使用しています。

[popoverController presentPopoverFromRect:[ボタン境界] inView:ボタンを許可ArrowDirections:UIPopoverArrowDirectionUp アニメーション化:YES];

ポートレートモードに適しています。私の質問は、画面のポートレート モードに関してポップオーバーを常に上に表示する方法ですか? 誰かが何か考えがあれば助けてください...よろしくお願いします。

4

1 に答える 1

0

あなたの方法を次の方法に置き換えるよりも常にポートレートモードを使用したい場合

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  {
   return (interfaceOrientation == UIInterfaceOrientationPortrait);
   }
于 2012-06-27T11:10:24.297 に答える