放置自定义动画代码以关闭 modalviewcontroller 的正确位置在哪里。
我尝试将以下内容放入 viewdiddisappear、viewwilldisappear 中,但行为不正确。有什么想法吗?谢谢!!
[UIView beginAnimations:@"suck" context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:103 forView:self.navigationController.view cache:YES];
[UIView setAnimationPosition:CGPointMake(260, 431)];
[UIView commitAnimations];
最佳答案
试试这个:
UIViewController *myController = [[[MyViewController alloc] init] autorelease];
UIViewAnimationTransition transition = UIViewAnimationTransitionCurlUp; // or whatever effect you want
[UIView beginAnimations:nil context:nil];
[UIView setAnimationTransition:transition forView:[self window] cache:YES];
[navController presentModalViewController:myController animated:NO]; // or dismissModalViewController in your case
[UIView commitAnimations];
关于objective-c - 在 dismissModalViewController 中自定义 UIView 动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10507781/