2012-08-09 38 views
0

使用https://github.com/vieux/Android-Horizontal-ListView使用开源的Android Horizo​​ntalListView,与layout_height =“WRAP_CONTENT”

意想不到的效果所以我想和多个水平列表视图的屏幕。这是我的XML文件。

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:background="#fff" 
    > 

    <com.devsmart.android.ui.HorizontalListView 
    android:id="@+id/listView1" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:background="#fff" 
    /> 

    <com.devsmart.android.ui.HorizontalListView 
    android:id="@+id/listView2" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:background="#fff" 
    /> 
</LinearLayout> 

唯一的问题是,当我做高度的wrap_content时,它将高度注册为整个屏幕。我进行了测试,以确保我的第二个列表视图是通过将第一个列表视图高度更改为设置的像素量并且都在那里。

我在github上读到了这个,这是一个已知的问题,但它说它是固定的......我想我错过了什么?

如果有人有任何经验,我会很感激!

+0

你有没有项目从你的帖子在github上的链接?现在不工作,我想要它。你可以发布吗? – Lunatikul 2013-08-21 13:11:39

+1

我相信是这样的:https://github.com/dinocore1/DevsmartLib-Android – 2013-09-09 05:42:08

回答

0

试试这个。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="#fff" 
android:orientation="vertical" > 

<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:background="#fff" 
    android:orientation="vertical" > 

    <com.devsmart.android.ui.HorizontalListView 
     android:id="@+id/listView1" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:background="#fff" /> 

    <com.devsmart.android.ui.HorizontalListView 
     android:id="@+id/listView2" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:background="#fff" /> 
</LinearLayout> 

如果你没有得到解决,然后重播。

相关问题