2011-02-04 8 views
1

何らかの理由により、私のカスタムリストビューがほとんどのように見えません。この時点では、それは単一のTextViewです(私は後で追加しました)が、2つの問題があります。カスタマーリストビューが期待どおりに動作しない

1)選択された項目は、Viewの行全体ではなく、内部TextViewのみを選択します(理由は?)。

2)ページをスクロールすると、View TextViewsはすべて黒くなります。これはスクロールイベント中にのみ発生します。

ここに関連するビューがあります。主な活動では:

<ListView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:background="#ffffff" 
     android:id="@+id/chapterList" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent">  

そして章のリスト(個々の項目)。

<?xml version="1.0" encoding="UTF-8"?> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/widget44" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 
    android:paddingTop="5px" 
    android:paddingBottom="5px" 
    android:gravity="center_horizontal"> 
<TextView 
    android:id="@+id/chapter_text" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textColor="#000000" 
    android:textColorHighlight="#656565"></TextView> 
</LinearLayout> 

答えて

0

次のリンクを確認してください。ここで私はlistviewを適切に使うための完全なコードを述べました。 これを使用すると、任意のリストビューの動作を実現できます。アニメーションも埋め込むことができます。

Change ListView background - strange behaviour

このヘルプを願っています:)

関連する問題