Skip to content

Instantly share code, notes, and snippets.

@msomu
Created September 25, 2015 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msomu/dd8ae34751a73b304e28 to your computer and use it in GitHub Desktop.
Save msomu/dd8ae34751a73b304e28 to your computer and use it in GitHub Desktop.
A gist for showing textview on the Image view, this util is for giving grey background to the image
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient
android:angle="90"
android:endColor="@android:color/transparent"
android:startColor="@android:color/black" />
<corners android:radius="0dp" />
</shape>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/actionbar_gradient_dark" />
</FrameLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment