在PullToRefreshListView中将wrap_content设置为layout_height

时间:2014-10-15 05:41:12

标签: android pull-to-refresh

我在布局中的PullToRefreshListView中将wrap_content设置为layout_height PullToRefreshListView有一个标题。

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:background="@color/my_investment_list_bg">
<View
        android:layout_width="3px"
        android:layout_height="match_parent"
        android:layout_marginLeft="24dip"
        android:background="@color/timeline"/>
<com.handmark.pulltorefresh.library.PullToRefreshListView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:divider="@null"
        android:listSelector="@android:color/transparent"
        android:id="@+id/list"/>
</FrameLayout>

现在,当开始此活动时,即使我有一些数据和notifyDataSetChanged,也只显示标题。
我不想在PullToRefreshListView中将match_parent设置为layout_height。因为,如果列表中没有数据,我想在标题的底部和屏幕的底部之间显示标题和另一个视图。
有什么想法吗?

1 个答案:

答案 0 :(得分:1)

我的项目中有类似的问题。问题在于这种类型的列表,因为它可以在这种布局结构中显示,如果它具有这个属性设置android:layout_height =“match_parent”那么,在这种情况下我就这样离开它,我改变了高度以编程方式为wrap_content,在我填充列表后,如下所示:Key\Value