繁体   English   中英

如何在Android中的ListView末尾获得阴影效果?

[英]How to get a shadow effect at end of the ListView in android?

我试图在放置在DrawerLayout中的ListView的末尾获得阴影效果。 我有一个用于阴影效果的png图像。 我只想知道如何放置它。 我尝试创建一个视图并将该图像作为背景图像放置,但是whlw布局会产生阴影。 我的xml文件在下面,请逐步指导我该怎么做。

    <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" />

你可以加

 list.addFooterView(footerView);

并在页脚视图中插入阴影图像以获取详细信息链接

您只需要将该PNG阴影图像放置为列表视图的背景即可。

    <ListView
    android:id="@+id/listView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"     
    android:background="@drawable/profile_background"
    />

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM