2013-12-14 45 views
0

在我的應用程序中,我使用groupIndicator進行可擴展列表視圖,但圖像顯示不正確並且伸長,我如何設置圖像的寬度和高度?Android:設置可繪製的寬度和高度

這是我的代碼:

<ExpandableListView 
      android:layout_weight="1" 
      android:layout_width="fill_parent" 
      android:layout_height="0dp" 
      android:id="@+id/expandableListView" 
      android:groupIndicator="@drawable/group_indicator"/> 

group_indicator.xml:

<?xml version="1.0" encoding="utf-8"?> 

<selector xmlns:android="http://schemas.android.com/apk/res/android"> 
    <item android:drawable="@drawable/plus" android:state_empty="true"/> 
    <item android:drawable="@drawable/minus" android:state_expanded="true"/>  
</selector> 
+1

您可以添加顯示問題的屏幕截圖。它可以幫助用戶給出正確的答案 – JoelFernandes

+0

可繪製的資源或形狀? –

+0

@EmilPana drawables是我將它們添加到我的項目中的圖像。 –

回答

0

爲您加號和減號,你已經在使用group_indicator.xml可繪製創建9片圖像。

+0

你能解釋我能做到嗎? –