gpt4 book ai didi

objective-c - 在 dismissModalViewController 中自定义 UIView 动画

转载 作者:行者123 更新时间:2023-11-28 22:57:31 25 4
gpt4 key购买 nike

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com