2012-01-23 49 views

回答

2

您可以使用ImageViewsrc指向你的圖像作爲手柄:

<SlidingDrawer 
    android:id="@+id/drawer" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 

    android:handle="@+id/handle" 
    android:content="@+id/content"> 

    <ImageView 
     android:id="@id/handle" 
     android:src="@drawable/my_image" 
     android:layout_width="wrap_content" 
     android:layout_height="fill_parent" /> 

    .... 

</SlidingDrawer> 

你可能會想給圖像轉換成9patch因此它可以被拉伸以填充整個窗口的高度。

0

將背景圖像添加到SlidingDrawer的按鈕。

1

你應該使用一個選擇滑塊按鈕,這樣你可以有不同的狀態不同的圖像(聚焦,聚焦非等)

<?xml version="1.0" encoding="utf-8"?> 
<selector xmlns:android="http://schemas.android.com/apk/res/android"> 
    <item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/focused" /> 
    <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/focusedpressed" /> 
    <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/pressed" /> 
    <item android:drawable="@drawable/defaultbutton" /> 
</selector>