2011-10-25 5 views
1

私は背景を持つ1つのxmlファイルで使用している展開可能なリストビューを持っています。読み込み時にはうまく見えますが、各リスト要素の背景をブラウズしている間に、ベースビューの背景の前に表示されることがあります。Android製のExpandableListView要素には透明な背景があります

リスト要素は、独自のXMLファイルで定義されています。

リスト要素の背景を何とか透明にすることができるので、ビューを展開/折りたたむときでも、ベースビューの背景が常に表示されますか?

答えて

2

答えはここで見つけることができます:)

http://developer.android.com/resources/articles/listview-backgrounds.html

使用

android:cacheColorHint="#00000000" 

あなたのリストに

+0

、大きな感謝:それは

android:childDivider="@android:color/transparent" android:listSelector="@android:color/transparent" android:cacheColorHint="@android:color/transparent" android:background="@android:color/transparent" 

またはプログラムexpandablelistviewのtransperentを設定する....私のために働きました! – KaiserJohaan

0

これにexpandablelistviewのためのすべての4つのプロパティを設定します。働い

ExpListview SecondLevelexplv = new ExpListview(mContext); 

SecondLevelexplv.setBackgroundColor(Color.TRANSPARENT); 
SecondLevelexplv.setCacheColorHint(Color.TRANSPARENT); 
SecondLevelexplv.setDivider(new ColorDrawable(Color.TRANSPARENT)); 
SecondLevelexplv.setSelector(android.R.color.transparent); 
関連する問題