1

縦向きで実行するように設計されたアプリがありますが、すべて問題ありません。ただし、横向きモードを必要とする Mobfox の vAd を実装しました。

現在、vAD が呼び出されると、次のエラーが発生します。

2013-01-08 23:44:05.109 Tv - IOS[1422:907] mobfox video did load
2013-01-08 23:44:05.125 Tv - IOS[1422:907] *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'

したがって、修正によりアプリのランドスケープが可能になると考えています。

アプリを強制的に縦向きで実行する必要がありますが、vAd が呼び出されたときに横向きを許可する必要があります

要約すると、次のようになります。

通常のアプリ表示中は縦向きのみ、mobFox vAd ビューが表示されている間は横向き/縦向きが必要です。

4

2 に答える 2

4

戻る: NO_shouldAutorotate

-(BOOL)shouldAutorotate {
  return NO;
}

または、 (少なくとも 1 つ)YESを返す必要がある場合は、ここで唯一許可されているポートレート:supportedInterfaceOrientations

- (NSUInteger)supportedInterfaceOrientations{
  return UIInterfaceOrientationMaskPortrait;
  if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
      return UIInterfaceOrientationMaskAll;
  }
}
于 2013-01-08T23:49:53.453 に答える
-1

わかりました、これで寝た後、私は最終的に問題を解決することができました.

解決策: UINavigationController をサブクラス化し、自動回転メソッドをオーバーライドして、プロジェクト > ターゲット > 概要設定ですべての回転を許可する必要がありました

- (BOOL)shouldAutorotate {
return NO;
}

- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
// pre-iOS 6 support 
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
}
于 2013-01-09T09:08:41.410 に答える