我怎样才能让一个ListView舒展开来填补剩余空间的页脚?

编程入门 行业动态 更新时间:2024-10-28 18:23:30
本文介绍了我怎样才能让一个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.

这可能吗?

推荐答案

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

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

更多推荐

我怎样才能让一个ListView舒展开来填补剩余空间的页脚?

本文发布于:2023-06-08 03:59:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/576222.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:剩余   空间   ListView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!