2011-11-18 69 views
0

一些主要內容和所有節標題不填充他們的列表視圖行。任何想法,可能是什麼問題?爲什麼我的列表視圖的背景顯示?

enter image description here

date_section layout: <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="#A1A1A1" 
    > 
<TextView android:layout_width="fill_parent" 

       android:id="@+id/post_date" 
       android:layout_height="wrap_content" 
       android:textStyle = "normal" 
       android:textColor="#ffffff" 
       android:background="#A1A1A1" 
       android:textSize="15dp" 
       android:minHeight="0dp" 
       /> 
</LinearLayout>     

單元佈局:

<?xml version="1.0" encoding="utf-8"?> 
<!-- hi new changes --> 
<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="@drawable/list_background" 
    > 




    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:orientation="vertical" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:minHeight="80dp" 
     android:layout_weight="0.8"> 

      <TextView android:layout_width="fill_parent" 
       android:id="@+id/post_title" 
       android:layout_height="wrap_content" 
       android:textStyle = "normal" 
       android:textColor="#202020" 
       android:textSize="15dp" 
       android:paddingTop="5dp" 
       android:paddingLeft="5dp" 
       android:paddingRight="5dp" 
       android:text="test" 
       /> 
      <TextView android:layout_width="fill_parent" 

       android:id="@+id/post_execerpt" 
       android:textColor="#888888" 
       android:textStyle = "italic" 
       android:textSize="14dp" 
       android:layout_height="wrap_content" 
       android:paddingLeft="5dp" 
       android:paddingRight="5dp" 
       android:lines="2" 
       android:text="test" 
       /> 
    </LinearLayout> 

</LinearLayout> 
+3

試將textview寬度設置爲「fill_parent」 – coder

+0

您可以粘貼您的佈局嗎? – zode64

+0

就像hsnepen提到的那樣,確保列表項的寬度爲fill_parent。 – serkanozel

回答

0

在你date_section.xml文件,該行添加到TextView

android:layout_width="fill_parent" 

好運

+0

它已經在那裏,除非我的眼睛背叛了我 –

+0

你可以嘗試刪除'android:textStyle =「normal」'行嗎?這只是一個猜測! – iTurki