2013-04-18 19 views
0

我有一個列表視圖,但在開始我想放置一段文字,這將有助於用戶瞭解該列表的目的是什麼。之後,我想顯示列表,我想要可以滾動。滾動我知道如何去做,但文字部分沒有。我試過做兩個佈局,一個用於文本,另一個用於列表,但是我的xml立即變成填充錯誤。如何在android中的列表視圖之前添加說明文字?

這是我的XML

<?xml version="1.0" encoding="utf-8"?> 


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@drawable/legislatie1" 
    android:orientation="vertical" > 



    <ListView 
     android:id="@+id/listView1" 
     android:layout_width="wrap_content" 
     android:layout_height="600dp" 
     android:layout_alignParentRight="true" 
     android:drawSelectorOnTop="true" 
     android:textSize="10pt" > 

    </ListView> 

</RelativeLayout> 
+2

在列表視圖上方放置一個textview。更新文本視圖 – Raghunandan

+0

它的工作,thx! – user2152480

回答

0

您可以使用一個靜態的TextView ListView的上面,如果你選擇,但它不會使用ListView滾動。另一種方法是向您的ListView添加一個Header,它將隨列表一起滾動。 Header Tutorial

相關問題