如何在iPhone中缩放图像? [英] How to zoom image in iPhone?

查看:109
本文介绍了如何在iPhone中缩放图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在iphone中缩放图像...当用户双击图像时,它将被放大,然后在下一次点击时它将被缩小....任何人都可以指示我如何做到这一点?????? b $ b $ div

I need to zoom an image in iphone...while the user double clicks on the image it will be zoomed in and on the next click it will be zoomed out....Can anybody direct me to how to do this???

推荐答案

您可能需要使用 size 属性 UIImage ,由 UIImageView touchesBegan 方法触发。

You would probably have to use the size property of UIImage, triggered by UIImageView's touchesBegan method.

如果你想让缩放效果平滑,你也可以使用动画。

You can also use animations if you want the zoom effect to be smooth.

另一种选择可能是将 UIImageView 放在 UIScrollView 中,或使用 UIWebView

Another option could be to place your UIImageView inside a UIScrollView, or use a UIWebView.

另外,我建议你看一下 Three20 项目。我认为 TTPhotoView 支持缩放。

Also, I suggest you take a look at the Three20 project. I think TTPhotoView supports zooming.

这篇关于如何在iPhone中缩放图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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