比较简单,设置好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. Magento后台表单字段添加备注

    Magento的后台表单封装的非常好,各种字段都能够直接找到方法调用.在最近的一个项目中,为客户定制了一款定时变价功能,该功能需要导入一个csv作为变价的基础.为了方便客户,我们需要在上传表单位置添加 ...

  2. Magento怎么设置和使用Cookie和Session?

    Magento中cookie和session是已经封装了的 Magento的核心对象-Mage_Core_Model_Cookie & Mage_Core_Model_Session Mage ...

  3. Threads Events QObjects

    Events and the event loop Being an event-driven toolkit, events and event delivery play a central ro ...

  4. 如何避免后台IO高负载造成的长时间JVM GC停顿(转)

    译者著:其实本文的中心意思非常简单,没有耐心的读者建议直接拉到最后看结论部分,有兴趣的读者可以详细阅读一下. 原文发表于Linkedin Engineering,作者 Zhenyun Zhuang是L ...

  5. 设置viewport进行缩放

    <meta name="viewport" content="width=320,maximum-scale=1.3,user-scalable=no"& ...

  6. 用jquery将复选框改成单选框

    前提是要包含jquery文件. 相关代码: jQuery(function($) { init_price_checkbox("by_price"); init_price_che ...

  7. 【转】eclipse 安装插件

    eclipse安装插件或许没有什么多的可讲,但对于刚刚接触eclipse这款IDE的新手来说,可能还是会有点棘手! eclipse安装插件大致三种方法: 方法一:自身安装器 使用eclipse的Sof ...

  8. C/C++中的隐藏依赖

    转载自:http://trarck.googlecode.com/svn/trunk/article/C/%E9%9A%90%E8%97%8F%E4%BE%9D%E8%B5%96.txt 隐藏依赖:即 ...

  9. 104. Maximum Depth of Binary Tree

    Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the long ...

  10. dll清理

    結束了閉關,又得與人類交流了,只好裝QQ 印象中企鵝手腳一向是BAT中最乾淨的-結果還是裝了不少樂色,一併挖出來除之   C:\program files\common files\tencent\q ...