Android: Can I use a zoom control in an imageview?

ε祈祈猫儿з 提交于 2019-12-03 09:05:06
Sephy

ImageView does not have a built-in zoom control. Please use the search option before asking question, you would have found your answer : How to make my ImageView zoomable? which mentions that there seems to be a way although there is no built in. Please correct your title to make it easier to find with a search, for instance : is there a way to zoom on an ImageView in Android

I'd advice you to use a WebView

 String page = "<html><body><center><img src=\""+path to your image+"\"/></center></body></html>";
    webView.loadDataWithBaseURL("fake",page, "text/html", "UTF-8","");

So you're creating a simple HTML page with your picture and then display it in the webView.

You can enable built-in zoom with zoomControl ( and maybe in the same time Multi-touch Zoom gesture for MultiTouch devices ?). You've also 2-dimension drag ( Vertical + Horizontal Scroll at the same time).

That's why it's really faster to use a WebView !

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!