-1
-(NSUInteger)supportedInterfaceOrientations
{           
    return UIInterfaceOrientationMaskPortrait;
}

-(BOOL)shouldAutorotate
{
    return NO;
}

アプリの1つのビューで横向きを有効にしたいだけです。他のビューは、ポートレートモードのみをサポートする必要があります。しかし、iOS 6の場合、iOS 6の最新の方法を使用していても、自動回転します。正しい提案を期待しています。

4

1 に答える 1

0

縦向きのみの向きの場合 は、以下の方法を試してください

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationPortrait;
}

- (BOOL)shouldAutorotate {
    return FALSE;
}
于 2013-02-28T08:58:25.067 に答える