UIViewAnimationTransitionCurlUp从横向(左和右)方向从右到左
我试图用UIViewAnimationTransitionCurlUp在两个视图之间进行转换。 我的应用程序在横向(左和右)工作,我需要从右向左转换。 UIViewAnimationTransitionCurlUp从下往上(而不是从右到左,因为我想)。 我的第一个版本是:UIViewAnimationTransitionCurlUp从横向(左和右)方向从右到左
self.oneView = [[[UIImageView alloc] initWithFrame:frame] autorelease];
self.twoView = [[[UIImageView alloc] initWithFrame:frame] autorelease];
[self.view addSubview:self.oneView];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[self.oneView removeFromSuperview];
[self.view addSubview:twoView];
[UIView commitAnimations];
它的工作景观带回家键,右侧(过渡是从右到左开始与右上角如需要)。 但是,当设备旋转到左侧的home按钮时,卷曲效果是颠倒的:从左到右以左角开始)。 动画似乎并不知道设备的方向。 我为了使用中间容器视图(self.view和
self.oneView/twoView):
self.containerView = [[[UIView alloc] initWithFrame:frame] autorelease];
self.oneView = [[[UIImageView alloc] initWithFrame:frame] autorelease];
self.twoView = [[[UIImageView alloc] initWithFrame:frame] autorelease];
[self.view addSubview:self.containerView];
[self.containerView addSubview:self.oneView]
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.containerView cache:YES];
[self.oneView removeFromSuperview];
[self.containerView addSubview:twoView];
[UIView commitAnimations];
之间改变代码现在它意识到装置旋转并工作正常两个横向。 但是,从下到上工作(已启动。与右下角),因为它在文档中描述 但我希望它由右至左的工作 我还试图用变换的观点就像性质:
self.containerView.transform = CGAffineTransformMakeRotation(-M_PI_2);
self.oneView.transform = CGAffineTransformMakeRotation(M_PI_2);
它并没有帮助 所以,一个问题是: 如何在横向模式(左侧和右侧)中使用过渡UIViewAnimationTransitionCurlUp在从右到左的视图之间进行过渡? 感谢您的帮助! Alex
您是否尝试过使用UIViewAnimationTransitionCurlDown
?这是UIViewAnimationTransitionCurlUp
的相反方向。
是的,实际上我使用UIViewAnimationTransitionCurlUp和UIViewAnimationTransitionCurlDown在几个图像之间向前和向后移动。我只是简化了问题的描述,避免了无关的事情。 – ashumilov
你可以从右向左转换吗? – Beto