Skip to content

Instantly share code, notes, and snippets.

@snadjafi
Created November 20, 2013 20:28
Show Gist options
  • Select an option

  • Save snadjafi/7570436 to your computer and use it in GitHub Desktop.

Select an option

Save snadjafi/7570436 to your computer and use it in GitHub Desktop.
frame to mask underling view
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content" android:layout_width="fill_parent">
<!-- this can be any layout that you want to mask -->
<LinearLayout android:id="@+id/mainLayout"
android:layout_height="wrap_content"
android:layout_width="fill_parent" android:orientation="vertical"
android:background="@android:color/white">
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_gravity="center"
android:text="Random text..." />
</LinearLayout>
<!-- FRAME TO MASK UNDERLYING VIEW -->
<ImageView android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:background="@drawable/grey_frame"
android:layout_alignTop="@+id/mainLayout"
android:layout_alignBottom="@+id/mainLayout" />
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment