DrawerLayout 谁是菜单栏测试结果

通过测试发现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>
测试结果:





posted @ 2015-03-09 23:21  就不呵呵呵  阅读(335)  评论(0编辑  收藏  举报