-1

I am trying to get a shadow effect at the end of my ListView which is placed inside a DrawerLayout. I have a png image for the shadow effect. I just want to know how to place it. I tried creating a view and placing this image as a background image, but the wholw layout gets the shadow. My xml file is below and please guide me step by step what to do.

    <android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">


<FrameLayout
    android:id="@+id/content_frame"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />




<ListView
    android:id="@+id/left_drawer"
    android:layout_width="240dp"
    android:visibility="visible"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:choiceMode="singleChoice"
    android:divider="@android:color/transparent"
    android:dividerHeight="0dp"
    android:background="@android:color/black"/>

<View
        android:id="@+id/vieworange"
        android:layout_width="10dp"
         android:layout_height="match_parent"

        android:background="@drawable/menushade"
        android:visibility="visible" />

anu_r
  • 1,602
  • 7
  • 30
  • 61

2 Answers2

4

You can add

 list.addFooterView(footerView);

and insert shadow image in footer view for details link!

Community
  • 1
  • 1
Umer
  • 1,566
  • 2
  • 20
  • 31
1

You just need to place that PNG shadow image as a background of your listview. i.e.

    <ListView
    android:id="@+id/listView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"     
    android:background="@drawable/profile_background"
    />
Howli
  • 12,291
  • 19
  • 47
  • 72
Krupa Patel
  • 3,309
  • 3
  • 23
  • 28
  • I want a black background for the Listview and the shadow effect at the end of the listview. Setting android:backround just gives me the shadow and not the black color – anu_r Apr 30 '14 at 10:34
  • Ok, so for that you need to create one 9 patch image with shadow and black background .so that you can set it as a background which will serves both purpose black background and shadow – Krupa Patel Apr 30 '14 at 10:36