1

I have two images (ImageViews), one in the background that displays a world map with the different countries of the world. The second image is an invisible mask with different colors for each country to distinguish which country the user clicked because every country has a different non-rectangular shape.

I want to make the world map zoomable using pinch zoom. There are libraries like PhotoView but only supporting one ImageView to be scaled when the user zooms in.

I need both images to be scaled (at the same time) when the user zooms, how can I do this?

trinity420
  • 670
  • 7
  • 19

1 Answers1

1

I had this problem for weeks! I finally found this approach to do it. The strategy is to put your images in a RelativeLayout and then put that RelativeLayout into a custom ZoomView class. Therefore when you zoom in, the whole view will zoom in, including images which are embedded.

Community
  • 1
  • 1
  • Hello sir, the custom view that has been created supports double tap zoom and pinch to zoom? And also can you help me implement this code? – Kartik Apr 13 '19 at 07:55