Xcodeを使用してiPhone用に開発されたアプリがあり、ビューコントローラーを縦向きモードで回転を有効にして表示します。
私のテーブル ビューには、モーダル モードで新しいビュー コントローラー (iPhoneSignVC) をトリガーするセルがあります。私の質問は...
最初から新しいモーダル ビュー コントローラーの向きを決定する方法はありますか?? つまり...新しいView Controllerをランドスケープモードにし、その特定のviewControllerで画面回転機能をアクティブにしないようにしたい
これまでのところ、UINavigationコントローラーのクラスを上書きする新しいクラスを作成することでした
#import "UINavigationController.h"
#import "iPhoneSignVC.h"
@implementation UINavigationController (overrides)
- (BOOL)shouldAutorotate
{
id currentViewController = self.topViewController;
if ([currentViewController isKindOfClass:[iPhoneSignVC class]])
return NO;
return YES;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
id currentViewController = self.topViewController;
if ([currentViewController isKindOfClass:[iPhoneSignVC class]]){
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
return (interfaceOrientation == UIInterfaceOrientationMaskAll);
}
@end
私は成功せずにこれを試しました...
ご支援いただきありがとうございます。