我想開發功能類似這樣的如何設置ListView的底端動態
當任何項目被添加,然後底部RelativeLayout
將VISIBLE
如果未選擇任何項目,那麼它GONE
問題: 我有這樣的問題:
圖1: 代碼:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="50dp"
android:background="@android:color/white" >
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
</ListView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true" >
<View
android:id="@+id/sprator"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="@android:color/black" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_margin="10dp"
android:src="@drawable/icon" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_margin="10dp"
android:src="@drawable/icon" />
</RelativeLayout>
</RelativeLayout>
當沒有項目被選中,那麼底部RelativeLayout
將GONE
像圖像2
當任何項目被添加然後底部RelativeLayout
將VISIBLE
像圖3 3
ü上啓動,然後代碼張貼代碼 –