Android: how to make a clickable map image with each country producing a different action?

前端 未结 4 1687
天命终不由人
天命终不由人 2021-01-26 05:42

I need to display a pretty image of a map of Europe, and I want my app to, e.g. bring up a different activity, when the user clicks each country - each country on the map needs

4条回答
  •  难免孤独
    2021-01-26 05:58

    I followed clausundercover's answer but still had problems with the consistency of the pixel color over a region. What finally worked for me is to make sure that I use a PNG image with indexed color for the mask. In my case I used the web optimized palette (216 colors) and made sure that any colors I picked were values from that palette. Once I made this change, I got the same color value over the entire region.

提交回复
热议问题