trinity420
trinity420

Reputation: 707

How to zoom multiple images at once in android?

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?

Upvotes: 1

Views: 1235

Answers (1)

Arash Dadkhah
Arash Dadkhah

Reputation: 47

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.

Upvotes: 1

Related Questions