2012-12-19 121 views
1

我有一个活动,我有一个列表视图。在列表视图的顶部,我包含另一个布局活动,其中包含两个用于过滤列表视图的旋钮。但是,如果我包括过滤器列表视图不起作用。它没有得到填充。如果我删除它列表视图正在填充。如果包含其他活动,Listview未被填充Android

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

    <include android:id="@+id/filter" layout="@layout/activity_expense_list_filter" /> 

    <ListView 
     android:id="@android:id/list" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"   
     android:layout_alignParentLeft="true" 
     android:layout_below="@id/filter" 
     android:layout_marginTop="23dp" 
     android:drawSelectorOnTop="false">     
    </ListView> 

</RelativeLayout> 

如果我删除过滤器视图列表视图工作正常。任何想法如何我可以解决这个

+0

也发布另一个xml代码和java代码 –

回答

0

什么是activity_expense_list_filter.xml布局?它是否也包含一个也称为@android:id/list的元素?

编辑:

我有,它被名为“过滤器”,包含的布局是完全模糊你的列表中的感觉。它在100%时是不透明的吗?

+0

不,因为我说它只包含两个spinners。这是一个相对布局,以定位两个旋转器的顶部和左侧和右上角。它没有列表 – swordfish

0

我发现问题是因为我在其他布局中添加了宽度和高度作为match_parent。所以它位于列表视图的顶部,它占用了从视图中隐藏列表视图的整个宽度和高度。我将其设置为wrap_content并将其修复。