Skip to content

Instantly share code, notes, and snippets.

@bbirec
Created May 1, 2013 07:21
Show Gist options
  • Save bbirec/5494147 to your computer and use it in GitHub Desktop.
Save bbirec/5494147 to your computer and use it in GitHub Desktop.
Relative layout trick
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout android:id="@+id/map_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
</RelativeLayout>
<Button android:id="@+id/current_location_center"
android:layout_width="50dp"
android:layout_height="0dp"
android:layout_centerInParent="true"
android:visibility="invisible"
android:contentDescription="My location dummy"/>
<ImageView android:id="@+id/current_location"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/marker_pin"
android:layout_centerHorizontal="true"
android:layout_alignBottom="@id/current_location_center"
android:contentDescription="My location"/>
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment