How can I get zoom functionality for images?

后端 未结 13 1195
粉色の甜心
粉色の甜心 2020-11-22 02:13

Is there a common way to show a big image and enable the user to zoom in and out and pan the image?

Until now I found two ways:

  1. overwriting ImageView,
13条回答
  •  悲&欢浪女
    2020-11-22 02:31

    I used a WebView and loaded the image from the memory via

    webview.loadUrl("file://...")
    

    The WebView handles all the panning zooming and scrolling. If you use wrap_content the webview won't be bigger then the image and no white areas are shown. The WebView is the better ImageView ;)

提交回复
热议问题