Search code examples
androidslidingdrawerandroid-scrollview

Android: ScrollView not behaving properly


I have a Sliding drawer and I have put a scrollview in it. The text views contains a lot of texts. I limited the height of the sliding drawer to 100 dip but they don't seem to be scrollable. Please help.

Here's a snippet of the xml:

<SlidingDrawer
    android:id="@+id/slidingDrawer"
    android:handle="@+id/drawerHandle"
    android:content="@+id/contentLayout"
    android:layout_width="wrap_content"
    android:layout_height="100dip"
    android:orientation="horizontal" 
    android:layout_gravity="center_vertical">

    <RelativeLayout 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        android:id="@+id/handlerl" 
        android:paddingBottom="0dp">

        <ImageView
            android:id="@+id/drawerHandle"
            android:src="@drawable/help_tab_selector"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true" >
        </ImageView>

    </RelativeLayout>

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

    <RelativeLayout
        android:id="@+id/contentLayout"
        android:gravity="center"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="#B0B0B0">



        <TextView
            android:id="@+id/helptv1"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="• Hello this contains a very long text" 
            android:paddingTop="5dp"
            android:paddingBottom="5dp"
            android:paddingLeft="5dp"
            android:paddingRight="5dp"
            android:textColor="#000000">
        </TextView>

        <TextView
            android:id="@+id/helptv2"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_below="@+id/helptv1"
            android:text="• Hello this contains a very long text" 
            android:paddingTop="5dp"
            android:paddingBottom="5dp"
            android:paddingLeft="5dp"
            android:paddingRight="5dp"
            android:textColor="#000000">
        </TextView>

        <TextView
            android:id="@+id/helptv3"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_below="@+id/helptv2"
            android:text="• Hello this contains a very long text" 
            android:paddingTop="5dp"
            android:paddingBottom="5dp"
            android:paddingLeft="5dp"
            android:paddingRight="5dp"
            android:textColor="#000000">
        </TextView>



    </RelativeLayout>
    </ScrollView>


</SlidingDrawer>

Solution

  • Try changing the ContentLayout id from your inner relative view to the ScrollView to see if that assists.

    Other than that, I am not quite sure. ScrollView is a trickster...