Android 如何使我的 ImageView 可缩放?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1939103/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to make my ImageView zoomable?
提问by capecrawler
Can anyone help on how to use the matrix scaletype to zoom an imageview and also how to use the translate method so that it can be focused at the center? I have tried using webview to be able to use the zooming and scrolling functionalities i needed but it is not nice to look at.
任何人都可以帮助了解如何使用矩阵 scaletype 来缩放图像视图以及如何使用 translate 方法使其可以聚焦在中心?我曾尝试使用 webview 来使用我需要的缩放和滚动功能,但看起来不太好。
回答by capecrawler
I found a tutorialdivided into 4 parts from a blogon how to zoom and pan an image and it is quite nice. It has sample codes that can be downloaded and some explanations. It also have other tutorials.
我从一篇关于如何缩放和平移图像的博客中找到了一个分为 4 个部分的教程,它非常好。它有可以下载的示例代码和一些解释。它还有其他教程。
Update- pointed the links to the new ones.
更新- 将链接指向新链接。
Update 2- I found a ready-to-use class for ImageView zooming functionality. You check it out here.