我在 iOS 6.0 sdk 中开发项目,它应该在 iOS4.3+ 设备上运行,在我的项目中,我使用页面卷曲来导航页面之间,但是 LandscapeLeft 中发生的页面卷曲与 Landscape Right 中的 Pagecurl 不同。
我希望在横向左侧发生的相同页面卷曲在横向右侧。
请查看链接以更好地理解。
视频演示链接
我使用的代码如下所示
-(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];
}
谁能告诉我我在这段代码中做错了什么。任何帮助将不胜感激。