DrawerLayout侧滑布局点击不响应事件

来源:互联网 发布:scala java bean 编辑:程序博客网 时间:2024/05/29 08:40

drawerlayout必须放在主界面布局后面

google的api是这样写的

To use a DrawerLayout, position your primary content view as the first child with a width and height of match_parent. Add drawers as 

child views after the main content view and set the layout_gravity appropriately. Drawers commonly use match_parent for height with

 a fixed width.

  <android.support.v4.widget.DrawerLayout        android:id="@+id/contact_drawer_layout"        android:layout_width="match_parent"        android:layout_height="match_parent">        <!-- The navigation drawer -->        <include            android:layout_width="match_parent"            android:layout_height="match_parent"            layout="@layout/activity_contact_list_center"/>
<!--侧滑布局-->        <include            android:id="@+id/contact_list_side"            android:layout_width="match_parent"            android:layout_height="match_parent"            android:layout_gravity="start"            layout="@layout/activity_contact_list_side"/>    </android.support.v4.widget.DrawerLayout>

这样就OK了

0 0
原创粉丝点击