XML : How to work with DrawerLayout in xml Android studio

Hi i know this question is too silly but this really matters for the application. Working with xml is the big deal. I am facing lots of problems.

Its not allowing me just to drag and drop the things, When i do, its placing in some other position.

I can able to manage inside Relative layout but DrawerLayout I can't able to do what i want. Here is my XML

  <android.support.v4.widget.DrawerLayout      android:id="@+id/drawer_layout"      xmlns:android="http://schemas.android.com/apk/res/android"      xmlns:app="http://schemas.android.com/apk/res-auto"      android:layout_width="match_parent"      android:layout_height="match_parent"      android:fitsSystemWindows="true">          <android.support.v7.widget.Toolbar          android:id="@+id/toolbar"          android:layout_width="match_parent"          android:layout_height="?attr/actionBarSize"          android:background="?attr/colorPrimary"          app:layout_scrollFlags="scroll|enterAlways"/>            <!--  -->          <fragment              xmlns:android="http://schemas.android.com/apk/res/android"               xmlns:tools="http://schemas.android.com/tools"                 android:id="@+id/fragment"               android:name="corp.msf.com.facebookconnect.MainFragment"              tools:layout="@layout/fragment_main"             android:layout_width="match_parent"              android:layout_height="wrap_content" />    </android.support.v4.widget.DrawerLayout>    

I have Toolbar above and below that i want the fragment to come. But fragment occupies all the place ( overlaps on toolbar ) . How can i specify and how can i work with xmls easily. Any help welcomed. Thanks for reading.

No comments:

Post a Comment