有没有什么方法可以改变UIScrollView的zoomToRect的持续时间? [英] Any way of changing the duration of zoomToRect for UIScrollView?

查看:116
本文介绍了有没有什么方法可以改变UIScrollView的zoomToRect的持续时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法为动画的持续时间指定[UIScrollView zoomToRect:zoomRect animated:YES]

目前快速动画:是或即时动画:否

我想指定持续时间,例如 [UIScrollView setAnimationDuration:2] ;或类似的东西。

I'd like to specify a duration, eg [UIScrollView setAnimationDuration:2]; or something similar.

提前致谢!

推荐答案

使用UIView的动画。

Use the UIView's animations.

解释时间有点长,所以我希望这个小例子可以解决一些问题。
查看文档以获取进一步说明

It's a bit long to explain, so I hope this little example will clear things up a bit. Look at the documantation for further instructions

[UIView beginAnimations: nil context: NULL];
[UIView setAnimationDuration: 2];
[UIView setAnimationDelegate: self];
[UIView setAnimationDidStopSelector: @selector(revertToOriginalDidStop:finished:context:)];

expandedView.frame = prevFrame;

[UIView commitAnimations];

这是我正在进行的一个项目所以它有点具体,但我希望你能参见基础知识。

It's from a project I'm currently working on so it's a bit specific, but I hope you can see the basics.

这篇关于有没有什么方法可以改变UIScrollView的zoomToRect的持续时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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