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

2019-03-22 11:53发布

问题:

Can I apply zoom control in imageview

回答1:

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



回答2:

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 !



回答3:

check this

http://blogs.sonyericsson.com/developerworld/2010/05/26/android-one-finger-zoom-tutorial-part-2/