0

放置自定义动画代码以关闭 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];
4

2 回答 2

2

试试这个:

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];
于 2012-05-10T16:12:19.047 回答
0

我想我想通了。我按照以下示例进行操作:

http://developer.apple.com/library/ios/#samplecode/BubbleLevel/Introduction/Intro.html

基本上从超级视图中删除了第二个视图并重新插入了第一个视图。转换在后缀中正常工作。

谢谢您的帮助。

于 2012-05-12T09:37:04.380 回答