Do it like this:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <FrameLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> <LinearLayout android:id="@+id/left_drawer" android:layout_height="wrap_content" android:layout_width="240dp" android:orientation="vertical" android:layout_gravity="start" > <EditText android:id="@+id/EditText01" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Search" > </EditText> <ListView android:id="@+id/left_drawer_list" android:layout_width="match_parent" android:layout_height="wrap_content" android:choiceMode="singleChoice" android:divider="@android:color/transparent" android:dividerHeight="0dp" android:background="#111"/> </LinearLayout> </android.support.v4.widget.DrawerLayout>
In other words, no matter what happens in the first view, it will be set as a view of the content, and no matter what second view will be installed in the box. So just add the elements to the second view for the box and first for the content. Greetings :)
source share