我怎样才能让一个ListView舒展开来填补剩余空间的页脚? [英] How can I make the footer of a ListView stretch to fill the remaining space?

查看:157
本文介绍了我怎样才能让一个ListView舒展开来填补剩余空间的页脚?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可以包含任意数量的项目一个ListView。当它使用小于我想显示页脚填充在剩余空间中的屏幕的整个高度。

I have a ListView which can contain any number of items. When it uses less than the whole height of the screen I want to show a footer which fills the remaining space.

页脚只是一个平铺图像。我不能只将其设置为在ListView或其容器的背景,因为列表项目是部分透明的,并且它必须是主要的背景,而不是页脚可见通过他们

The footer is just a tiled image. I can't just set it as the background of the ListView or its container, because the list items are partially transparent and it must be the main background and not the footer visible through them.

添加页脚视图工作正常,如果页脚是一个固定的高度,但是如果固定高度大于剩余高度,然后在ListView滚动不必要地

Adding the footer view works fine if the footer is of a fixed height, but if the fixed height is more than the remaining height then the ListView scrolls unnecessarily.

制作页脚视图FILL_PARENT似乎没有任何影响,它只是不可见的。

Making the footer view fill_parent seems to have no effect, it's just invisible.

把页脚视图到父布局上也没有任何影响,因为ListView中似乎充满了整个高度,除非它给了一个固定的layout_height值。

Putting the footer view into the parent layout also has no effect, because the ListView seems to fill the whole height unless it's given a fixed layout_height value.

这可能吗?

推荐答案

尝试布局权重设置一个或退房手续试图合并的看法: 的http://android-developers.blogspot.com/2009/03/android-layout-tricks-3-optimize-by.html

Try setting the layout weight to one, or check out trying a merge view: http://android-developers.blogspot.com/2009/03/android-layout-tricks-3-optimize-by.html

这篇关于我怎样才能让一个ListView舒展开来填补剩余空间的页脚?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆