I want to add a light shadow on the right and bottom side of the layout.I tried using android:background="@android:drawable/dialog_holo_light_frame"
but it adds a thick shadow on all four sides of the layout.What drawable i need to create and set as background?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:drawable/dialog_holo_light_frame">
<ImageView
android:id="@+id/g"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:layout_gravity="center"
android:src="@drawable/logo_icon"
android:visibility="visible"
android:clickable="true" />
</LinearLayout>
I think this may solve your problem
Then apply it to an XML layout as a background
LinearLayout
android:background="@drawable/drawable_name"
This is what I referred and it worked.
** 1.Add a plain LinearLayout with grey color, over which add your actual layout, with margin at bottom and right equal to 1 or 2 dp
2.Have a 9-patch image with a shadow and set it as the background to your Linear layout**
Other solutions here