Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 转到上一个视图时如何获取动画_Iphone_Animation - Fatal编程技术网

Iphone 转到上一个视图时如何获取动画

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

我已将viewcontroller用于多视图。 当我回到上一页时,没有动画 我尝试了以下代码行

-(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当前位置这是你的问题,如果答案正确,为什么不投票表决呢?