与页眉,页脚和空的所有可见列表活动 [英] List activity with header, footer and empty all visible

查看:126
本文介绍了与页眉,页脚和空的所有可见列表活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想有一个ListActivity列表​​视图的页眉和页脚可见显示所有,即使列表数据是空的时间。

I would like to have the listview in a ListActivity be displayed with the header and footer visible all the time even if the list data is empty.

这是空列表导致空的观点出现,页眉和页脚消失。但是我的头已经过滤的用户界面,因此应始终可见。

An empty list causes the empty view to appear and the header and footer to disappear. However my header has filtering UI and should therefore always be visible.

我可以做到这一点,目前唯一的办法是,如果我把页眉和页脚出来的列表视图中,并在活动布局之外执行这些静态的观点。但是这些话总是可见,只有数据滚动。

The only way I can make it happen at the moment is if I take the header and footer out of the listview and implement them as static views outside in the activity layout. However then these are always visible and only the data scrolls.

我会preFER两个只是在上面的滚动列表和底部。结束语这一切在一个滚动视图不起作用,因为接下来还有两个嵌套的滚动视图(列表视图之外,包装的)。

I would prefer for both to just be on top and bottom of the scrolling list. Wrapping it all in a scroll view does not work since then there are two nested scroll views( the list view outside and the wrapping one).

有没有办法从像加了假记录黑客这样做很好地分开?

Is there a way to do this nicely apart from a hack like adding a fake record?

推荐答案

请您空视图包含你的头。

Make your empty view include your header.

 <ListView />
 <RelativeLayout
    android:id="@android:id/empty"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >
       // Add whatever you want here including your header
 </RelativeLayout>

这篇关于与页眉,页脚和空的所有可见列表活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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