达成Android 抽屉效果
发布时间:2021-11-30 12:53:48 所属栏目:教程 来源:互联网
导读:在Android开发过程中,我们喜欢使用特效,比如抽屉效果,这样可以给人很好的体验。点击一个按钮,就像拉抽屉一样展开界面,这样的效果正是我在这里所要说明的。比如在AVD或真机上,我们都有看过这种效果。比较常用的应用是LAUNCH应用。在这个应用中我们实现了
在Android开发过程中,我们喜欢使用特效,比如抽屉效果,这样可以给人很好的体验。点击一个按钮,就像拉抽屉一样展开界面,这样的效果正是我在这里所要说明的。比如在AVD或真机上,我们都有看过这种效果。比较常用的应用是LAUNCH应用。在这个应用中我们实现了拉抽屉呈现所有的程序,在这里我参考一些别人写的博客试例讲这种实现细节。 创建一个工程。在这里我命名为LauncherDemo.在这个例子中我在main.xml文件中写入如下,贴上代码: <?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" > <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="#00ff00"> <GridView android:id="@+id/allapps" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout> </SlidingDrawer> </LinearLayout> ![]() (编辑:泉州站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |