2011-06-20 39 views
1

我想在線性佈局中顯示日曆視圖的列表視圖。當我使用垂直佈局,然後列表視圖出現,但在水平佈局相同的列表視圖消失。我用相對佈局解決了這個問題,但我可以做到這一點使用線性layout.here是我的XML ...在水平佈局中顯示listview的問題?

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/ScrollView01" 
    android:layout_height="fill_parent"  
    android:layout_width="fill_parent"> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="horizontal" android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 


    <com.exina.android.calendar.CalendarView 
    android:layout_height="wrap_content" 
    android:id="@+id/calendar" android:layout_width="wrap_content"> 
    </com.exina.android.calendar.CalendarView> 
<ListView android:layout_height="fill_parent" android:id="@+id/android:list" 
    android:layout_weight="1" android:scrollingCache="false" 
    android:layout_width="fill_parent" android:drawSelectorOnTop="false" 
    android:dividerHeight="4.0sp"></ListView> 
</LinearLayout> 
</ScrollView> 

回答

1

您需要設置fillviewport國旗在滾動視圖:

android:fillViewPort="true" 

檢查這個鏈接知道什麼fillviewport標誌:ScrollView