新 IOS 中的动画更改视图

发布于 2024-12-14 13:40:11 字数 424 浏览 2 评论 0原文

我似乎无法弄清楚如何在新的 ios 5 中使用动画更改视图。我有这段代码,它只是切换视图,但没有任何类型的动画。这是我到目前为止的代码:

-(IBAction)back:(id)sender{

if ([self respondsToSelector:@selector(dismissViewControllerAnimated:completion:)])
{
    NSLog(@"didTouchDoneButton 5.x");
    [self dismissViewControllerAnimated:NO completion:nil];
}
else
{
    NSLog(@"didTouchDoneButton 4.x");
    [self dismissModalViewControllerAnimated:NO];
}

}

i cant seem to figure out how to change the views using animation in the new ios 5. i have this code which just switches the views but without any type of animation. This is the code i have so far:

-(IBAction)back:(id)sender{

if ([self respondsToSelector:@selector(dismissViewControllerAnimated:completion:)])
{
    NSLog(@"didTouchDoneButton 5.x");
    [self dismissViewControllerAnimated:NO completion:nil];
}
else
{
    NSLog(@"didTouchDoneButton 4.x");
    [self dismissModalViewControllerAnimated:NO];
}

}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

治碍 2024-12-21 13:40:12

当您使用 presentModalViewController:animated 时,您可以使用方法 [myModalViewController setModalTransitionStyle: UIModalTransitionStylePartialCurl

When you use presentModalViewController:animated you can change the animation with the method [myModalViewController setModalTransitionStyle: UIModalTransitionStylePartialCurl.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文