0

私はiOS4.3以降のデバイスで動作するはずのiOS 6.0 SDKでプロジェクトを開発しています.
横向きの左で発生しているのと同じページカールが横向きの右になるようにします。
リンク先を見て理解を深めてください。 ビデオデモリンク

私が使用したコードを以下に示します

    -(IBAction)nextBtnTapped {

    UIDeviceOrientation deviceOrientation=[UIDevice currentDevice].orientation;

    page2 *Obj=[[page2 alloc]init];

    [UIView beginAnimations:nil context:NULL];

    [UIView setAnimationDuration:1];

    if (deviceOrientation==UIDeviceOrientationLandscapeLeft) 

        [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO];

    else if(deviceOrientation==UIDeviceOrientationLandscapeRight) 

        [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO];

    [self.navigationController pushViewController:Obj animated:NO];

    [UIView commitAnimations];
}


-(IBAction)prevBtnTapped {

    UIDeviceOrientation deviceOrientation=[UIDevice currentDevice].orientation;

    [UIView beginAnimations:nil context:NULL];

    [UIView setAnimationDuration:0.8];

    if (deviceOrientation==UIDeviceOrientationLandscapeLeft) 

        [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO];

    else if(deviceOrientation==UIDeviceOrientationLandscapeRight) 

        [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO];

    [self.navigationController popViewControllerAnimated:YES];

    [UIView commitAnimations];
}

このコードで何が間違っているのか教えてください。どんな助けでも大歓迎です。

4

1 に答える 1

0

UIDeviceOrientationLandscapeLeftページカールのバグがあります。正しく動作しません。

于 2012-12-19T11:40:01.090 に答える