title: Adding a linear layout to Navigation drawer (ends up crashing with a ClassCastException)
body: <p>I am trying to add a vertical linear layout (having a title, image, menu title, listview and an icon at the bottom)to the navigation drawer. However the app crashes displaying </p>
  
  <pre><code>'java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.support.v4.widget.DrawerLayout$LayoutParams'
  </code></pre>
  
  <p>error. I am not sure if this is possible straight ways as I checked couple of links and the only close I got was <a href="https://stackoverflow.com/questions/16942792/how-to-add-title-in-navigation-drawer-layout">this.</a> Any help is appreciated.
  Thanks in advance. 
  Here is my code.
      </p>
  
  <pre><code>&lt;!-- The main context view --&gt;
  
  &lt;FrameLayout
      android:id="@+id/content_frame"
      android:layout_width="match_parent"
      android:layout_height="match_parent" /&gt;
  
  &lt;!-- The navigation drawer --&gt;
  
  &lt;LinearLayout        
      android:layout_width="240dp"
      android:layout_height="match_parent"
      android:layout_gravity="start"
      android:background="#fff"
      android:gravity="bottom|center"
      android:orientation="vertical"
      android:paddingTop="30dp" &gt;
  
      &lt;ListView
          android:id="@+id/left_drawer"                        
          android:choiceMode="singleChoice"
          android:divider="#E8E8E8"
          android:dividerHeight="1dp"
          android:footerDividersEnabled="false"
          android:headerDividersEnabled="false" /&gt;
  
      &lt;ImageView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:padding="10dp"
          android:src="@drawable/footer_image" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>Now the issue here is, xml is not allowing me to define width and height for the listview (Element  is unknown) and I am also not able to run it as compiler says "You must supply a layout_width" attribute?? Please help.</p>
  
  <p>My code with the scrollview.</p>
  
  <pre><code>&lt;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" &gt;
  
  &lt;!-- The main context view --&gt;
  
  &lt;FrameLayout
      android:id="@+id/content_frame"
      android:layout_width="match_parent"
      android:layout_height="match_parent" /&gt;
  
  &lt;!-- The navigation drawer --&gt;
  
  &lt;ScrollView
      android:id="@+id/leftRL"
      android:layout_width="240dp"
      android:layout_height="match_parent"
      android:layout_gravity="start"
      android:layout_marginBottom="5dp"
      android:background="#fff" &gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical" &gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:paddingLeft="10dp"
              android:paddingRight="10dp"
              android:paddingTop="10dp" &gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:paddingBottom="3dp"
                  android:src="@drawable/ic_launcher"
                  android:text="Dummy"
                  android:textColor="#2E3192"
                  android:textStyle="bold" /&gt;
  
              &lt;View
                  android:layout_width="fill_parent"
                  android:layout_height="2dip"
                  android:background="#2E3192" /&gt;
  
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:orientation="horizontal"
                  android:paddingTop="2dp" &gt;
  
                  &lt;ImageView
                      android:layout_width="0dp"
                      android:layout_height="match_parent"
                      android:layout_weight="3"
                      android:background="#e8e8e8"
                      android:scaleType="fitXY"
                      android:src="@drawable/ic_launcher" /&gt;
  
                  &lt;LinearLayout
                      android:layout_width="0dp"
                      android:layout_height="match_parent"
                      android:layout_weight="7"
                      android:gravity="center"
                      android:orientation="vertical"
                      android:padding="5dp" &gt;
  
                      &lt;TextView
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:text="Dummy name"
                          android:textSize="15sp" /&gt;
  
                      &lt;TextView
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:text="dummyemail@imhot.com"
                          android:textSize="10sp" /&gt;
                  &lt;/LinearLayout&gt;
              &lt;/LinearLayout&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="20dp"
                  android:paddingBottom="3dp"
                  android:src="@drawable/ic_launcher"
                  android:text="Dummy item"
                  android:textColor="#2E3192"
                  android:textStyle="bold" /&gt;
  
              &lt;View
                  android:layout_width="fill_parent"
                  android:layout_height="2dip"
                  android:background="#2E3192" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;ListView/&gt;
  
          &lt;ImageView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center"
              android:layout_marginTop="40dp"
              android:padding="10dp"
              android:src="@drawable/footer_image" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>