新 IOS 中的动画更改视图
我似乎无法弄清楚如何在新的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您使用
presentModalViewController:animated
时,您可以使用方法 [myModalViewController setModalTransitionStyle: UIModalTransitionStylePartialCurl。When you use
presentModalViewController:animated
you can change the animation with the method [myModalViewController setModalTransitionStyle: UIModalTransitionStylePartialCurl.