android 抽屉特效
1、 SlidingDrawer 抽屉控件
<SlidingDrawer android:id="@+id/sliding" android:layout_width="match_parent" android:layout_height="match_parent" android:content="@+id/home_water" // 指定内容控件id android:handle="@+id/handler" // 指定handler 控件id android:orientation="horizontal" > <TextView android:id="@+id/handler" android:layout_width="@dimen/title_height" android:layout_height="@dimen/title_height" android:text="@string/app_name" /> <include layout="@layout/home_item" /> </SlidingDrawer>
sd.setOnDrawerOpenListener(new SlidingDrawer.OnDrawerOpenListener()// 开抽屉
{
public void onDrawerOpened()
{
iv.setImageResource(R.drawable.touch_handler);// 响应开抽屉事件
}
});
sd.setOnDrawerCloseListener(new SlidingDrawer.OnDrawerCloseListener()
{
@Override
public void onDrawerClosed()
{
iv.setImageResource(R.drawable.touch_handler);// 响应关抽屉事件
}
});