Share the post "Create Custom Button Like Zoom In Android Map"
The only way to have a custom button like the zoom buttons in Android map is to make one of your own. The way I did this is to have an XML drawable assigned to the ImageButton. It is pretty simple.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:state_enabled="true"> <shape android:shape="rectangle"> <corners android:radius="2dp"/> <solid android:color="#95cccccc"/> </shape> </item> <item android:state_enabled="true"> <shape android:shape="rectangle"> <corners android:radius="2dp"/> <solid android:color="#95ffffff"/> </shape> </item> </selector> |
Then assign this as background to the ImageButton widget. Your image should be assigned to the source attribute.
That’s it!