0

私のプロジェクト設定では、サポートされているインターフェイスの向きを両方のランドスケープとして作成しました。

それでも、各View Controllerに以下を実装する必要がありますか?

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
4

2 に答える 2

3

iOS <6.x

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation // Deprecated in iOS 6.x 
{
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

iOS> 6.x

- (BOOL) shouldAutorotate
{
    return YES;
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}

これがお役に立てば幸いです。

于 2013-03-26T05:20:02.140 に答える
0

ya実装する方が良いですし、info.plistに実装すると、ランドスケープへのオリエンテーションが良いでしょう。

iOS>6の場合

- (BOOL) shouldAutorotate
{
    return YES;
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}
于 2013-03-26T05:14:58.707 に答える