SlidingDrawer类使用的时候主要包括两点:
1:handle:单击的按钮
2:content:抽屉中的内容,单击按钮时,抽屉的内容隐藏或显示
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#808080"
>
<SlidingDrawer
android:id="@+id/slidingdrawer"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:handle="@+id/handle"
android:content="@+id/content">
<Button
android:id="@+id/handle"
android:layout_width="88dip"
android:layout_height="44dip"
android:background="@drawable/handle"
/>
<LinearLayout
android:id="@+id/content" android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg1">
<GridView android:id="@+id/all_apps"
android:persistentDrawingCache="animation|scrolling" android:layout_centerHorizontal="true"
android:alwaysDrawnWithCache="true" android:scrollbars="none"
android:drawSelectorOnTop="false" android:listSelector="@drawable/selector_bg"
android:numColumns="auto_fit" android:columnWidth="78px"
android:stretchMode="spacingWidth" android:layout_weight="1.0"
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:paddingLeft="20px" android:paddingRight="20px"
android:visibility="visible"
></GridView>
</LinearLayout>
</SlidingDrawer>
</LinearLayout>
效果图:
- 大小: 9.9 KB
- 大小: 52 KB
分享到:
相关推荐
Android Launcher抽屉类SlidingDrawer的使用
Aj_01 来自:http://blog.csdn.net/Android_Tutor/archive/2010/04/14/5486804.aspx 测试:Android Launcher抽屉类SlidingDrawer的使用!
安卓中1.5后加入了SlidingDrawer【隐藏式抽屉】,设计原理在你的UI布局有限的情况下,放不下太多的控件的时候,可以考虑用这个隐藏式抽屉。用SlidingDrawer注意两点,一个是android:handle(委托要展开的图片加载...
实用的 Android SlidingDrawer抽屉效果
本人最近发现了有趣的抽屉类,写了一个Demo与大家分享,希望能帮到大家!
android各种抽屉实例的工程项目,有上拉,下拉,左拉,右拉的各种情况。导入eclipse即可运行。基于android2.2版本。全部源码都有。
一个Android滑动抽屉,上滑打开,滑下来关闭,也有自动倒带。 支持正常布局,Listview,ScrollView,RecyclerView。
界面,实现一个layout或任何控件的向右拉出,向左收回效果。slidingdrawer的变形。在eclipse可直接运行。
默认显示抽屉的一部分,屏幕分上下二部分;通过打开按钮实现,抽屉的下面部分打开和关闭,同时上面部分自动伸展。
Android UI开发——SlidingDrawer 抽屉效果~~
SlidingDrawer抽屉类小例子,android平台
Android 用SlidingDrawer实现抽屉效果
这个范例非常非常非常的好,实现了从屏幕的任何方向拉出抽屉,值得借鉴……
SlidingDrawer效果想必大家也见到过,它就是1.5模拟器上进入应用程序列表的效果。下面是截图 ...SlidingDrawer android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:handl
抽屉效果
Android SlidingDrawer控件的使用。开发环境Android studio3.0版本
SlidingDrawer抽屉式滑动效果
android SlidingDrawer 可以从上下左右四个方向拉出,只需要更改main.xml中的my:direction方向即可