TableLayout 布局

ericllzh 2010-05-19 01:42:08

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:stretchColumns="1">
<TableRow>
<EditText ../>
<EditText .../>
</TableRow>
<TableRow>
<EditText ../>
<EditText .../>
</TableRow>
<ListView/>
</TableLayout>
</ScrollView>


如果这样布局的话.listview的高度就只有可能45DP的高度.而不是把下面的的都填充完.
如何使得listview把底部都填充满呢?
...全文
331 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
cancel_li 2010-05-20
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 ericllzh 的回复:]
但有个疑问,一切屏后.列表的显示就会有问题了.
就是即使有全屏的ScrollView,拉到最低,也不能完全显示listview.
[/Quote]

应该可以的,你可以参考SDK内的联系人代码
ericllzh 2010-05-19
  • 打赏
  • 举报
回复
但有个疑问,一切屏后.列表的显示就会有问题了.
就是即使有全屏的ScrollView,拉到最低,也不能完全显示listview.
cancel_li 2010-05-19
  • 打赏
  • 举报
回复
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
ericllzh 2010-05-19
  • 打赏
  • 举报
回复
设置android:layout_weight="1"了也不可以.
yyy025025025 2010-05-19
  • 打赏
  • 举报
回复
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:stretchColumns="1">
<TableRow>
<EditText ../>
<EditText .../>
</TableRow>
<TableRow>
<EditText ../>
<EditText .../>
</TableRow>
<ListView android:layout_height="0"
android:layout_weight="1"/>
</TableLayout>
</ScrollView>
ericllzh 2010-05-19
  • 打赏
  • 举报
回复
mark

80,349

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧