listview下加一个button为什么button显不出来啊<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
> <TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/text"
android:text="@string/text"
/>
<ListView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/list1"
android:dividerHeight="1sp"
/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/button"/>
</LinearLayout>
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
> <TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/text"
android:text="@string/text"
/>
<ListView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/list1"
android:dividerHeight="1sp"
/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/button"/>
</LinearLayout>
解决方案 »
- 怎么适应不同分辨率
- starActivityforResult()函数的调用与响应流程问题
- SDK manager.exe 安装时一闪而过
- 菜鸟问题,在AndroidManifest.xml中添加Activity不成功。
- android上计时的方法是什么啊
- Android 如何自动测试 睡眠和唤醒
- 请教SDK Manager 下的各版本的api下的ARM EABI v7a System Image 和google apis 都没有显示
- AndroidManifest.xml中定义的标签存在警告怎样消除?
- 手机助手是怎么向手机导入短信
- 提问:Activity的运行机制
- android push
- Android 写了 HelloWorld 没显示 大家帮帮忙
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/button"
android:layout_weight="1"
/>
这么修改看看
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#ffffff"
>
<ListView
android:id="@+id/listView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/button1"
></ListView>
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="48dp"
android:layout_alignParentBottom="true"
android:text="回复" />
</RelativeLayout>
listview设置android:layout_above="@+id/button1"属性放在button上面,就ok了。
<ListView
android:id="@+id/list1"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="0.25"
android:background="#00ff00"
/>