Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it possible to use something other than a listview as sliding drawer in drawerlayout
    primarykey
    data
    text
    <p>I would like to have for example a <code>LinearLayout</code> or a <code>RelativeLayout</code> sliding from the left of the screen instead of a lone <code>ListView</code>.</p> <p>I tried to use à <code>LinearLayout</code> with <code>android:layout_gravity="start"</code> and i had this error at runtime:</p> <pre><code>ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.support.v4.widget.DrawerLayout$LayoutParams </code></pre> <p>here's the layout file:</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" android:background="@android:color/white" &gt; &lt;FrameLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /&gt; &lt;LinearLayout android:layout_width="320dp" android:layout_height="match_parent" android:layout_gravity="start" android:orientation="vertical"&gt; &lt;ImageView android:id="@+id/ivwLogo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/video_icon" /&gt; &lt;ListView android:id="@+id/left_drawer" android:layout_width="320dp" android:layout_height="match_parent" android:choiceMode="singleChoice" android:divider="@android:color/transparent" android:dividerHeight="0dp" android:background="@android:color/white" /&gt; &lt;/LinearLayout&gt; &lt;/android.support.v4.widget.DrawerLayout&gt; </code></pre> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload