2

Could someone tell me How to add a custom controller like a button to Google Map Android API V2? I searched a lot and took a look at https://developers.google.com/maps/documentation/android/intro , but nothing I could find in this regard. I have done the same before on web and using Javascript like adding a DIV to a map. For Android, I could not find anything.

Ark
  • 457
  • 1
  • 8
  • 18
  • you can add it in layout , its a view like any view you add it and take look on this thread http://stackoverflow.com/questions/14694119/how-to-add-buttons-at-top-of-map-fragment-api-v2-layout – mohammed momn Feb 12 '14 at 02:48
  • Thanks Mohammed for your response, the problem is that, I want to add a button on the bottom of the map and resize the map by clicking on it. The button should always be at the bottom of the map in any size. Could I set this by layout? – Ark Feb 12 '14 at 02:51

1 Answers1

3

Look this xml will put your Layout at the bottom of any View you will use in RelativeLayout

  <RelativeLayout
        android:id="@+id/footer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="#FC0"
        android:gravity="center" >

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="5dp"
            android:text="Fixed Footer"
            android:textColor="#000"
            android:textSize="20sp" />
    </RelativeLayout>
mohammed momn
  • 3,230
  • 1
  • 20
  • 16