2012-12-02 9 views
5

アダプタを使用してカスタムリストビューを使用しています.Nexus 7ではすべてが素晴らしいようですが、HTC Incredible 2では問題が発生しています私の背景色が変わります。ここで私のXMLファイルにcacheColorHintが設定されています。私も#AA00000で試しました。助言がありますか?私もsetCacheColorHint経由でアクティビティに設定しようとしましたが、まだ動作するものはありません。Androidリストビューの背景色が変更されました - colorCacheHint固定問題

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="horizontal"  
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:padding="10dp" 
android:background="#AA000000" 
android:cacheColorHint="#00000000"> 

<ImageView android:id="@+id/ExhibitListIcon" 
android:contentDescription="Exhibit List Icon" 
android:layout_width="wrap_content" 
android:layout_height="fill_parent" 
android:gravity="center_vertical" 
android:layout_marginRight="15dp" 
android:layout_marginTop="5dp" 
android:layout_marginBottom="5dp" /> 

<TextView android:id="@+id/ExhibitListTitle" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:gravity="center" 
android:textStyle="bold" 
android:textSize="22dp" 
android:textColor="#FFFFFF" 
android:layout_marginTop="5dp" 
android:layout_marginBottom="5dp" /> 

</LinearLayout> 

答えて

21

あなたが代わりのLinearLayoutのリストビューが宣言されたXMLにcachecolorhintを設定してみてくださいでした:

レイアウトファイル、使用時:

android:cacheColorHint="#0000" 

やJavaコードを、使用

listView.setCacheColorHint(Color.TRANSPARENT); 

+0

それをやりました!どうもありがとうございました。 –

+0

うれしい私は助けることができました....それが働く場合、あなたは答えとしてこれを受け入れることができます:) –

+0

完了します。再度、感謝します。 –

2
listView.setCacheColorHint(Color.TRANSPARENT); 
6

あなたのリストビューに行の下に追加します。

アンドロイド:cacheColorHint = "@アンドロイド:カラー/透明"

関連する問題