我想添加陰影到我的ListView項目的底部! 我嘗試了paddingEdageLenght,但沒有發生變化! 我加圓形邊緣,但我不能添加的項目添加陰影列表視圖的列表項底部
這是我的列表項的XML文件
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadingEdgeLength="5sp" >
<ImageView
android:id="@+id/site_image"
android:layout_height="50dp"
android:layout_width="65dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_margin="10dp"/>
<TextView
android:id="@+id/site_name"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_toRightOf="@id/site_image"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:textSize="20sp"/>
<TextView
android:id="@+id/site_description"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="@id/site_name"
android:layout_marginTop="5dp"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/site_image"
android:textSize="15sp"/>
</RelativeLayout>
下面的陰影,這是我的ListView XML文件
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
android:id="@+id/near_sites"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_margin="10dp"
android:fadingEdgeLength="5sp"
android:dividerHeight="10sp"
android:divider="@android:color/transparent" />
</RelativeLayout>
任何幫助?
轉到此[http://www.anotherandroidblog.com/2011/06/29/drop-shadow-linearlayout/](http://www.anotherandroidblog.com/2011/06/29/drop-shadow -linearlayerout /) –
現在,我們可以使用CardView with cardElevation和cardRaduis –