Android滑动抽屉处理程序';s形象
我想使用我自己的图像作为handler的图像 如何将默认处理程序映像更改为另一个映像? 谢谢Android滑动抽屉处理程序';s形象,android,image,handle,slidingdrawer,Android,Image,Handle,Slidingdrawer,我想使用我自己的图像作为handler的图像 如何将默认处理程序映像更改为另一个映像? 谢谢 Eyal.将背景图像添加到滑动抽屉按钮。您可以使用图像视图,其中src指向您的图像作为手柄: <SlidingDrawer android:id="@+id/drawer" android:layout_width="fill_parent" android:layout_height="fill_parent" android:handle="@+id
Eyal.将背景图像添加到滑动抽屉按钮。您可以使用
图像视图
,其中src
指向您的图像作为手柄:
<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>
....
您可能希望将该图像转换为9面片,以便可以拉伸以填充窗口的高度。您应该为滑块按钮使用选择器,以便可以为不同的状态(聚焦、非聚焦等)生成不同的图像
<?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>