ScrollView as a first element in Navigation Drawer

I'm trying to create a navigation drawer that looks like google play store. What I've noticed in google play store drawer is that it's scrollable top to bottom (not only the listview). I managed to create a beautiful drawer that opens and closes correctly. But when I use a scrollview as a first element in drawer layout, navigation drawer glitches and shows up always on the screen as a scattered layout. I use this code (I removed scrollview content for clarity, plus, even just one LinearLayout with 2-3 simple buttons in it, is enough to show the glitch, so it's irrelevant):

<?xml version="1.0" encoding="utf-8"?>
<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">
    <!-- Main Layout -->
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
        android:orientation="vertical"
        android:id="@+id/screen"
        android:layout_height="wrap_content"
        tools:context=".Intro"
        android:weightSum="1">
    </LinearLayout>
    <!-- Drawer Layout -->
    <ScrollView
        android:layout_width="270dp"
        android:layout_height="match_parent">

....
....
...
    </ScrollView>

Note that I used fixed height elements in the scroll view, and also removed ALL the listviews & expandable list views (views with auto scrolling) without any luck.

Answers


I used navigation drawer as following:

<android.support.v4.widget.DrawerLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/drawer_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity">

    <FrameLayout
            android:id="@+id/container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

    <fragment android:id="@+id/navigation_drawer"
              android:layout_width="@dimen/navigation_drawer_width"
              android:layout_height="match_parent"
              android:layout_gravity="left"
              android:name="com.xxx.NavigationDrawerFragment"
              tools:layout="@layout/fragment_navigation_drawer"/>

</android.support.v4.widget.DrawerLayout>

And inside the fragment layout

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:tools="http://schemas.android.com/tools"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="vertical"
              android:background="@color/white"
              tools:context=".com.xxx.NavigationDrawerFragment">

    <ScrollView
            android:id="@+id/list_drawer_menu"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

</LinearLayout>

Need Your Help

Rails 3.2.3 with spork does not recognize helper methods in cucumber tests

ruby-on-rails cucumber spork

I have a application that is using rails 3.2.3 and spork 1.0.0rc2.

Php Header linking to different links depending on page

php header

I recently changed my bilingual website of 23 html pages to 23 php pages (The site is: www.creativemindspcs.org.) With this change, I included php headers, footers, and navigation.