主要还是XML的布局:main.xml

Code:
  1. <?xmlversion="1.0"encoding="utf-8"?>
  2. <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
  3. android:orientation="vertical"
  4. android:layout_width="fill_parent"
  5. android:layout_height="fill_parent"
  6. android:background="#808080"
  7. >
  8. <SlidingDrawer
  9. android:id="@+id/slidingdrawer"
  10. android:orientation="vertical"
  11. android:layout_width="fill_parent"
  12. android:layout_height="fill_parent"
  13. android:handle="@+id/handle"
  14. android:content="@+id/content"
  15. >
  16. <Button
  17. android:id="@id/handle"
  18. android:layout_width="88dip"
  19. android:layout_height="44dip"
  20. android:background="@drawable/handle"
  21. />
  22. <LinearLayout
  23. android:id="@id/content"
  24. android:layout_width="fill_parent"
  25. android:layout_height="fill_parent"
  26. android:background="#00ff00"
  27. >
  28. <Button
  29. android:id="@+id/button"
  30. android:layout_width="wrap_content"
  31. android:layout_height="wrap_content"
  32. android:text="button"
  33. />
  34. <EditText
  35. android:id="@+id/text"
  36. android:layout_width="fill_parent"
  37. android:layout_height="wrap_content"
  38. />
  39. </LinearLayout>
  40. </SlidingDrawer>
  41. </LinearLayout>

handle.xml

Code:
  1. <?xmlversion="1.0"encoding="utf-8"?>
  2. <selectorxmlns:android="http://schemas.android.com/apk/res/android">
  3. <item
  4. android:state_window_focused="false"
  5. android:drawable="@drawable/handle_normal"
  6. />
  7. <item
  8. android:state_pressed="true"
  9. android:drawable="@drawable/handle_pressed"
  10. />
  11. <item
  12. android:state_focused="true"
  13. android:state_enabled="true"
  14. android:drawable="@drawable/handle_focused"
  15. />
  16. <item
  17. android:state_focused="true"
  18. android:drawable="@drawable/handle_focused"
  19. />
  20. </selector>

虽然简单,但是很实用!以后会用得着的!

更多相关文章

  1. Android开发者实用代码片段 与大家分享
  2. Android(安卓)ui utils-简单实用的Android界面工具
  3. Android(安卓)ui utils-简单实用的Android界面工具
  4. Android(安卓)MVVM结合DataBinding的简单实用(Android(安卓)studi
  5. 安卓应用实用功能的技术实现:《Android消息推送实现》 | Android(
  6. Android(安卓)实用工具Hierarchy Viewer实战
  7. Android(安卓)实用工具Hierarchy Viewer实战
  8. android实用代码片段
  9. Android(安卓)实用工具Hierarchy Viewer实战

随机推荐

  1. 《网工必备技术命令大全》
  2. Microsoft Edge浏览器的Universal XSS漏
  3. 投资ipfs要多少钱?ipfs靠谱吗?
  4. OSPF学习笔记整理(上)
  5. lftp链接异常情况如何进行排查
  6. 世界上没有绝对安全的手机,保护iPhone安全
  7. OSPF学习笔记整理(中)
  8. Gookit Banking Trojan中的后门利用分析
  9. CCIE考试中常用的show,赶紧收藏吧!
  10. 信息安全行业的门槛有多高?安全行业个人职