码迷,mamicode.com
首页 > 其他好文 > 详细

DrawerLayout 谁是菜单栏测试结果

时间:2015-03-10 00:04:42      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:

通过测试发现layout_gravity来控制DrawerLayout的菜单页面
一般的说法是DrawerLayout的第一个子节点是内容页面,
第二个子节点是DrawerLayout的菜单页面
  1. <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2. xmlns:tools="http://schemas.android.com/tools"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. >
  6. <FrameLayout
  7. android:layout_width="match_parent"
  8. android:layout_height="match_parent"
  9. android:background="#fff" //注:白色
  10. android:layout_gravity="start"
  11. >
  12. </FrameLayout>
  13. <FrameLayout
  14. android:layout_width="match_parent"
  15. android:layout_height="match_parent"
  16. android:background="#ff0" //注:黄色
  17. >
  18. </FrameLayout>
  19. </android.support.v4.widget.DrawerLayout>
测试结果:
技术分享

  1. <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2. xmlns:tools="http://schemas.android.com/tools"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. >
  6. <FrameLayout
  7. android:layout_width="match_parent"
  8. android:layout_height="match_parent"
  9. android:background="#fff" //白色
  10. >
  11. </FrameLayout>
  12. <FrameLayout
  13. android:layout_width="match_parent"
  14. android:layout_height="match_parent"
  15. android:background="#ff0" //黄色
  16. android:layout_gravity="start"
  17. >
  18. </FrameLayout>
  19. </android.support.v4.widget.DrawerLayout>
测试结果:
技术分享




DrawerLayout 谁是菜单栏测试结果

标签:

原文地址:http://www.cnblogs.com/candledragle/p/4d6111ebdde070c7c107c41c99dbb9df.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!