Question

i want to create a clickable image. For example, if we think about world as an image and when a continent is clicked/selected, it will show its name in an alert box. I don't know how to do it can somebody help me? thanks

Was it helpful?

Solution

It all depends on how precise you want to be but the simplest solution would be to have an ImageView of your world map inside of a relative layout. On top of which layer invisible Buttons using @android:color/transparent for the background property. Customise the width and height values manually with dp to get your desired size.

For this context of the problem, continent clicking, this should suffice.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top