我想开发功能类似这样的如何设置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
ü上启动,然后代码张贴代码 –