android页面布局 如何让中间的listView填充剩余部分 我在做一个页面,这个页面分三块,最上面是标题栏,最下面是负责翻页的框,这两个部分在屏幕中位置始终不变,如果中间再加一个listView怎么让listView填充剩余部分呢,如果listView过长就会把下面的框推出去了Androidlistview布局 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 LinearLayout :<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="fill_parent" android:layout_height="50dip" android:background="#606060" android:text="顶部" /> <ListView android:id="@+id/list" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" /> <TextView android:layout_width="fill_parent" android:layout_height="50dip" android:background="#606060" android:text="底部" /></LinearLayout>RelativeLayout:<?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" > <TextView android:id="@+id/tv_top" android:layout_width="fill_parent" android:layout_height="50dip" android:background="#606060" android:layout_alignParentTop="true" android:text="顶部" /> <ListView android:id="@+id/list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@+id/tv_top" android:layout_above="@+id/tv_bottom" /> <TextView android:id="@+id/tv_bottom" android:layout_alignParentBottom="true" android:layout_width="fill_parent" android:layout_height="50dip" android:background="#606060" android:text="底部" /></RelativeLayout> android:layout_weight="1" 是关键。 楼上的,哈哈,上面还有个相对布局, 哪来的 weight,开始也差点被楼主忽悠了,哈哈 谢谢 zyxel60b的回答 问题解决了 android模拟器无法启动的问题 有没有办法自己写程序让照相机没有预览画面 如何运行adb命令 播放器的扬声器怎么控制啊 AlertDialog中执行调用消息机制操作意外停止!!!!????? Tabhost切换不同的activity,搞不清楚那里出错了。 百度云存储 BCS 文件上传,权限设置问题 Listview亮度显示的问题 android4.4是否可以接管系统的来去电界面 安卓 安卓模块局域网语音通话功能 自定义ViewGroup内的view布局问题!困扰快一天了,求救!
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" > <TextView
android:layout_width="fill_parent"
android:layout_height="50dip"
android:background="#606060"
android:text="顶部" /> <ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="50dip"
android:background="#606060"
android:text="底部" /></LinearLayout>RelativeLayout:<?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" > <TextView
android:id="@+id/tv_top"
android:layout_width="fill_parent"
android:layout_height="50dip"
android:background="#606060"
android:layout_alignParentTop="true"
android:text="顶部" /> <ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/tv_top"
android:layout_above="@+id/tv_bottom"
/> <TextView
android:id="@+id/tv_bottom"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="50dip"
android:background="#606060"
android:text="底部" /></RelativeLayout>
楼上的,哈哈,上面还有个相对布局, 哪来的 weight,开始也差点被楼主忽悠了,哈哈