In my application, i need to display a map of France, divided into 5 zones. I did it with an image editor : i divided my map into 5 parts and save each part as a png. Each PNG has the same size.

Now, I add 5 ImageView (with the same size) in a RelativeLayout and i obtain this :

France Map 5 Parts

The goal is now to make clickable zones as described on the map. I don't know how to do this (which layout ? how to put them in my layout ?...)

有帮助吗?

解决方案

Maybe RelativeLayout? You can place four background images in a regular way (using toLeftOf, toRightOf, below, ...) and one foreground image with alignParentTop and centerHorizontal set to true with proper layout_margins{Top, Left/Right}.

Also remember that android draws xml layouts from top to bottom, so your foreground image should be the last in layout file.

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