Iphone 转到上一个视图时如何获取动画
我已将viewcontroller用于多视图。 当我回到上一页时,没有动画 我尝试了以下代码行Iphone 转到上一个视图时如何获取动画,iphone,animation,Iphone,Animation,我已将viewcontroller用于多视图。 当我回到上一页时,没有动画 我尝试了以下代码行 -(IBAction)goback { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1]; [UIView setAnimationTransition: UIViewAnimationTransitionCurlDown forView:self.view cache:YES]; [self.v
-(IBAction)goback
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition: UIViewAnimationTransitionCurlDown forView:self.view cache:YES];
[self.view removeFromSuperview];
[UIView commitAnimations];
}
无法设置方法调用的动画。只能对视图的属性(如帧、大小、alpha等)设置动画。
removeFromSuperview
不是属性,它是一种只查找superview并从子视图数组中删除原始视图的方法
您需要运行动画,然后在动画完成时发送removeFromSuperview
使用下面的代码
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view.superview cache:YES];
[self.view removeFromSuperview];
[UIView commitAnimations];
这是多视图的正确答案application@jaydp当前位置这是你的问题,如果答案正确,为什么不投票表决呢?