私はアプリに取り組んでいます。アプリの向きは横ですが、アプリを実行した後、アプリのインターフェイスの向きを変更して回転させます。スプラッシュ スクリーンの正しい表示方法 (ランドスケープ)。私はios7を使用していますアプリはios5のコードでした私はいくつかの非推奨のAPIの問題があると思います.例えば、shouldAutorotateToInterfaceOrientationボットが呼び出された.
5 に答える
1
画像を参照してビルドで orintatoin を設定する必要があります。
それはあなたの問題を解決します。
于 2013-11-08T07:17:44.893 に答える
1
すべてのナビゲーション コントローラーがトップ ビュー コントローラーを尊重するようにしたい場合は、カテゴリを使用できるので、一連のクラス名を調べて変更する必要はありません。
@implementation UINavigationController (Rotation_IOS6)
-(BOOL)shouldAutorotate
{
return [[self.viewControllers lastObject] shouldAutorotate];
}
-(NSUInteger)supportedInterfaceOrientations
{
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}
@end
コメントのいくつかが指摘しているように、これは問題の迅速な修正です。より良い解決策は、UINavigationController をサブクラス化し、これらのメソッドをそこに配置することです。サブクラスは、6 と 7 のサポートにも役立ちます。
于 2013-11-08T06:25:19.313 に答える
0
これを試して:
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
}
編集 :
添付のリンクを参照してください。役立つ場合があります。
于 2013-11-08T05:55:06.343 に答える
0
これを Appdelegate.m で使用します
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
NSLog(@"Interface orientations");
if([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPad ){
return UIInterfaceOrientationMaskLandScape;
}
else{
return UIInterfaceOrientationMaskPortrait;
}
}
それは私を助けた..
于 2014-05-26T10:30:38.303 に答える
0
私は私がしていると思う解決策を見つけます。ステップ1は、カテゴリを作成してUInavigationcontrollerをオーバーライドします
ステップ 2 [self.window addSubview:[navigationController view]]; を置き換えます。//年
[self.window setRootViewController:navigationController]; //新着
于 2013-11-10T07:55:38.810 に答える