Android组件的抽屉(初级)

本人一开始看到抽屉效果的时候本以为很有难度结果……结果……..

就这么一个SlidingDrawer组件直接拖动到XML就实现了超汗!!!

上code

<SlidingDrawer

android:layout_width="match_parent"

android:id="@+id/slidingDrawer1"

android:layout_height="match_parent"

android:handle="@+id/handle"

android:content="@+id/content"

android:layout_alignParentBottom="true"

android:layout_alignParentLeft="true"

>

<Button

android:layout_width="wrap_content"

android:background="@drawable/gallery_background_1"

android:layout_height="wrap_content"

android:id="@+id/handle"></Button>

<LinearLayout

android:id="@+id/content"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical"

android:background="#CCFFFF">

<LinearLayout

android:id="@+id/content2"

android:layout_width="match_parent"

android:layout_height="80dp"

android:orientation="horizontal"

>

<ImageButton

android:id="@+id/Simagebutton1"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/a00"

android:layout_weight="1"

android:background="@null"

android:layout_margin="10dp"

></ImageButton>

<ImageButton

android:id="@+id/Simagebutton2"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/a01"

android:layout_weight="1"

android:background="@null"

android:layout_margin="10dp"

></ImageButton>

<ImageButton

android:id="@+id/Simagebutton3"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/a02"

android:layout_weight="1"

android:background="@null"

android:layout_margin="10dp"

></ImageButton>

<ImageButton

android:id="@+id/Simagebutton4"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/a03"

android:layout_weight="1"

android:background="@null"

android:layout_margin="10dp"

></ImageButton>

</LinearLayout>

<Button

android:id="@+id/Sbutton1"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_margin="15dp"

android:text="1111111"

android:layout_marginTop="15dp"

></Button>

<Button

android:id="@+id/Sbutton2"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_margin="15dp"

android:text="222222"

></Button>

<Button

android:id="@+id/Sbutton3"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_margin="15dp"

android:text="333333"

></Button>

<Button

android:id="@+id/Sbutton4"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_margin="15dp"

android:text="13424顺序各点6下"

></Button>

</LinearLayout>

</SlidingDrawer>

布局可以按自己想要实现的效果来布局这个效果我做的很丑只当做例子把让美工做些好看的图片来修饰它吧

效果

更多相关文章

  1. Android(安卓)自定义绚丽的进度条(类似H5实现的一种效果)
  2. Android(安卓)Studio——layout_weight体验(实现按比例显示)
  3. Android(安卓)popupwindow以及windowManager总结——实现悬浮效
  4. 可能是最详细的Android点击事件处理详解(三)
  5. Android自带人脸识别
  6. android 拍照和从相册选择组件
  7. Android(安卓)ApiDemos示例解析(3): App->Activity->Animation
  8. 详解Android的服务
  9. Android(安卓)四大组件的工作过程

随机推荐

  1. Android(安卓)实现书籍翻页效果
  2. 在用户组件中使用自定义标签
  3. 手把手教你逆向分析 Android(安卓)程序
  4. Android(安卓)之图片本地缓存解决方案
  5. android中的多线程编程及消息机制
  6. Android(安卓)解析启动白屏原理及解决方
  7. Android(安卓)任务和回退堆栈---管理任务
  8. 一次重拾Android(安卓)Studio开发的经历
  9. [原] Android持续优化 - 提高流畅度
  10. Android(安卓)UI 之CheckBox的妙用