我可以提高presentModalViewController的动画速度吗? [英] Can I increase the animation speed of presentModalViewController?

查看:155
本文介绍了我可以提高presentModalViewController的动画速度吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个绘图应用程序,当用户单击工具栏中的项目时,该应用程序会显示工具视图控制器。但是,我的一些beta版测试人员报告说,工具的味道打开得太慢了。我正在使用标准的presentModalViewController:animated:调用来显示工具,我尝试将它包装在这样的代码块中以加快速度:

I'm writing a drawing application that shows a tools view controller when the user clicks an item in a toolbar. However, several of my beta testers have reported that the tools palate opens too slowly. I'm using the standard presentModalViewController:animated: call to display the tools, and I've tried wrapping it in a code block like this to speed it up:

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration: 0.1];
[self presentModalViewController:settings animated:YES];
[UIView commitAnimations];

不幸的是,这不起作用。如果你说动画:不是它效果更好,但是底层绘图画布视图会被立即删除(因为控制器认为它不再可见),因此动画会在白色背景上发生。

Unfortunately, that doesn't work. If you say animated:NO it works better, but the underlying drawing canvas view is removed immediately (since the controller thinks it is no longer visible), and so the animation occurs over a white background.

有没有人在此之前愿意提供一些建议呢?我很感激!

Has anyone done this before that would be willing to offer some advice? I'd appreciate it!

推荐答案

提出了类似的问题此处

您也可以使用这种技术更改速度,但在我的实验中,它是在空白背景下进行的,正如您所建议的那样。

You can also change the speed using this technique, but in my experimentation, it does so over a blank background, as you've suggested.

这篇关于我可以提高presentModalViewController的动画速度吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆