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

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top