2011-11-11 10 views
0

iPhone開発者にとって新しい、私はIphoneでログイン画面を持っていますが、画面を半分だけ表示してから、横画面でログイン画面を表示するように変更しますが、風景モードで肖像画を表示し、別の画面にもナビゲートします。いずれかを助けてくださいiphoneのポートレートから風景を表示するには?

これらのコードは風景モードでは機能しませんが、私は動作する方向を変更します。

+0

uは、より特異的であることができます。 – iamsult

+0

こんにちは、私の問題は、肖像画の風景ビューを起動する方法ですか?お返事をありがとうございます。 – sankar

答えて

0
-(void) viewWillAppear:(BOOL)animated{ 
    UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation]; 

    [self willAnimateRotationToInterfaceOrientation:orientation duration:0]; 


} 

-(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration 
{ 
    if(toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) 
    { 
    set the view for potrait 
    } 
    else if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) 
    { 
    set the view for landscape 
    } 


} 
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    // Overriden to allow any orientation. 
    return YES; 
} 

希望があります。

+0

あなたのお返事ありがとうございます – sankar

+1

私は答えを持っている場合は、それをupvoteする必要があります。 – iamsult

0

「肖像画の風景」とはどういう意味ですか?あなたはこれを持っているか、両方を同時に持つことはできません(iPhoneを持っていなければ、P)

plistファイルでは、アプリの起動時に起動されるモードを決めることができます:) " 4つの方向のそれぞれについて。このことを設定する最速の方法。回転またはしないようにするアプリで、後に管理するためにかかわらず、あなたは

-(BOOL)shouldAutorotateToInterfaceOrientation:

希望を使用する必要があり、これは役立ちます:)

関連する問題