Is is possible to put fixed buttons (with image) on top of an android map.
I want to add buttons on top of the android map then when the user click on it, it performs something on the map.
Similar to the zoom control, but always visible.
Is is possible to put fixed buttons (with image) on top of an android map.
I want to add buttons on top of the android map then when the user click on it, it performs something on the map.
Similar to the zoom control, but always visible.
Put the map and the button in a relative layout. Something like:
<RelativeLayout>
<MapView>
...
</MapView>
<Button>
..make its align parent top property true here
</Button>
</RelativeLayout>
This should put the botton on top of the map and aligned to the top of the screen. And if you want to have a button with an image use ImageButton insead.
You're referring to depth or z-indexing when you're saying "on top of". Use FrameLayout and set MapView first then followed by Button.
<FrameLayout>
<MapView />
<Button .../>
</FrameLayout>
Edit I mentioned gravity which was wrong.
Related question: Placing/Overlapping(z-index) a view above another view in android