比较简单,设置好SlidingDrawer控件的handle和content属性就可以了。
 android:content="@+id/content"
 android:handle="@+id/handle" 就可以了。效果如下图:
抽屉没打开的时候。
 
从下往上托Handle按钮,打开抽屉

代码如下:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#808080"
tools:context=".MainActivity" > <SlidingDrawer
android:id="@+id/slidingdrawer"
android:layout_width="fill_parent"
android:layout_height="300dp"
android:content="@+id/content"
android:handle="@+id/handle"
android:orientation="vertical" > <Button
android:id="@+id/handle"
android:layout_width="88dip"
android:layout_height="44dip"
android:text="Handle"> </Button> <LinearLayout
android:id="@+id/content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#00ff00" > <Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pls Input:" /> <EditText
android:id="@+id/editText"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</SlidingDrawer> </RelativeLayout>

  这里做的比较简单,当然你可以做的更美观。

 
 

Android 抽屉类SlidingDrawer的使用的更多相关文章

  1. Android 抽屉效果

    昨天在用“酷我音乐”听歌的时候注意到了界面右上角的四角方块,当我点击这个方块的时候会从屏幕的左边弹出新的界面而把原来的界面挤到左边,是显示了一小部分. 于是,我便在网上查询了一下相关的文章,现将这种效 ...

  2. Android抽屉(SlidingDrawer --类似android通知栏下拉效果)

    Android抽屉(SlidingDrawer)的实现发 - 红黑联盟http://www.2cto.com/kf/201301/182507.html 可动态布局的Android抽屉之基础http: ...

  3. Android 抽屉效果的导航菜单实现

    Android 抽屉效果的导航菜单实现 抽屉效果的导航菜单 看了很多应用,觉得这种侧滑的抽屉效果的菜单很好. 不用切换到另一个页面,也不用去按菜单的硬件按钮,直接在界面上一个按钮点击,菜单就滑出来,而 ...

  4. android抽屉总结

    android抽屉:1.DrawerLayout 在xml文件中要注意写全称:android.support.v4.widget.DrawerLayout <LinearLayout /> ...

  5. android Activity类中的finish()、onDestory()和System.exit(0) 三者的区别

    android Activity类中的finish().onDestory()和System.exit(0) 三者的区别 Activity.finish() Call this when your a ...

  6. Android图像格式类及图像转换方法

    Android图像格式类及图像转换方法介绍 一款软件的开发和图像密切相关,特别是移动应用程序,在视觉效果等方面是至关重要的,因为这直接关系到用户的体验效果.在Android程序开发的过程中,了解存在哪 ...

  7. Android 服务类Service 的详细学习

    http://blog.csdn.net/vipzjyno1/article/details/26004831 Android服务类Service学习四大组建   目录(?)[+] 什么是服务 服务有 ...

  8. 项目源码--Android答题类游戏源码

    下载源码 技术要点: 1. 精致的答题UI 2. Android的Http通信技术 3. Android数据库QLITE与其他数据存储技术 4. Android在线音乐背景技术 5. Android答 ...

  9. android application类的用法

    android application类的用法 Application是android系统Framework提供的一个组件,它是单例模式(singleton),即每个应用只有一个实例,用来存储系统的一 ...

随机推荐

  1. magneto创建运费模板

    Magento系统自带了大概7种运费方式:平价.运费表.免运费.ups.usps.fedex.dhl等.不过这些依然无法满足我们的需求,这时候就需要创建一个shipping module 来实现了.创 ...

  2. Delphi第一个入门程序——鼠标点击计数 - imsoft.cnblogs

    实现的效果如下: 制作要点: 添加一个按钮Button1和一个标签Label1,并双击按钮进入编程界面在var  Form1: TForm1;下面一行加上  n:integer;//定义变量. 然后在 ...

  3. sql 语句累积

    // 查询用户表  手机号对应不只一个用户的手机号列表 跟数量 (项目在运营后晚上偶尔出现 多个用户对应一个手机号的情况) select mobile,count(mobile) from  go_m ...

  4. C++之STL之string

    /*C 语言中字符数组一般会采用char str[]来存放,但是显得会比较麻烦,C++在stl中加入了string类型,对字符串常用的功能进行了封装,操作起来比较方便*/#include<cst ...

  5. window IIS6/IIS7取消脚本执行权限,禁止运行脚本木马

    网站安全中,对目录的执行权限是非常敏感的,一般来说,可以写入的目录是不能够拥有脚本的执行权限的,可写入的目录如: data.uploads,data目录主要是基本配置文件和缓存数据,uploads则是 ...

  6. 工作中遇到的问题--实现程序运行时就加载CustomerSetting的第二种方法

    写一个自定义注解 @Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD})@Retention(Retention ...

  7. 放课后的约定 by:S_H_Y

    题目背景 十年.十年前.天空的蔚蓝,云彩的舒软.我,怎么会认识你.洁白的,洁白的,十年前.我无法忘却.终究是小时候的约定.记忆被困在冻土里,有时我不认识那天的我.难道一切,都锁在心里面了吗? 题目描述 ...

  8. POJ1087 A Plug for UNIX(网络流)

                                       A Plug for UNIX Time Limit: 1000MS   Memory Limit: 65536K Total S ...

  9. UI组件(思维导图)

  10. DBN(深度信念网络)

    DBN运用CD算法逐层进行训练,得到每一层的参数Wi和ci用于初始化DBN,之后再用监督学习算法对参数进行微调.本例中采用softmax分类器(下一篇随笔中)作为监督学习算法. RBM与上一篇随笔中一 ...