Androidアプリの開発中、ExpandableListViewを使用していたのですが、躓いています。
ExpandableListViewをレイアウトファイルで定義し、親グループの閉じる・開くの矢印(要するにgroupIndicator)を別の画像にしようと試みました。
しかしなぜか認識されないのです。
xml
1<LinearLayout 2xmlns:android="http://schemas.android.com/apk/res/android" 3 android:orientation="vertical" 4 android:layout_width="match_parent" 5 android:layout_height="match_parent"> 6 <ExpandableListView 7 android:layout_width="wrap_content" 8 android:layout_height="wrap_content" 9 android:id="@+id/hogehogelist" 10 android:groupIndicator="@drawable/hogehoge_groupindicator" 11 /> 12</LinearLayout>
drawableに指定したファイルは以下のような感じです。
xml
1<?xml version="1.0" encoding="utf-8"?> 2<selector xmlns:android="http://schemas.android.com/apk/res/android" 3 > 4 <item 5 android:drawable="@drawable/group_open" 6 android:state_expanded="true" 7 > 8 </item> 9 10 <item 11 android:drawable="@drawable/group_close" > 12 </item> 13</selector>
group_open.pngとgroup_close.pingは、drawableディレクトリに入っています。
一応、ソースコード上で設定すればどうにか認識してくれるんですが、これってやはりレイアウトファイルでは設定出来ないんでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。