2

アプリ内のビューの 1 つだけを右に横向きにしたいと考えています。他のすべてのビューはポートレート モードです。前のビューはポートレート モードです。横表示を縦表示にしました。どうすれば正しくできますか?

この肖像画(rootviewcontroller)


この風景

私のランドスケープビューコントローラーで:

//Orientation
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
    return (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
// New Autorotation support
-(BOOL)shouldAutorotate {
    return YES;
}

-(NSUInteger)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskLandscapeRight;
}
4

3 に答える 3

0

デバイスの向きを変更するには、次のように合計することができます..

-(void)viewDidLoad
{
    orientation = [[UIDevice currentDevice] orientation];
    if(intOrientation == UIInterfaceOrientationLandscapeRight)
                orientation = UIDeviceOrientationLandscapeRight;

}

それがあなたを助けることを願っています

于 2013-02-01T11:45:59.007 に答える
0

解決しました。ありがとうサン。私はこの例を使用しました:

こちらもご覧ください

またはこれ

于 2013-03-22T06:18:20.923 に答える
0

ビューコントローラーでこれを使用できます

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

これにより、向きが横向きになります。

于 2013-02-01T10:32:25.850 に答える