samedi 25 avril 2015

scrollview not growing vertically when content size increases beyond screen size


<ScrollView xmlns:android="http://ift.tt/nIICcg"
    xmlns:tools="http://ift.tt/LrGmb4"
    android:id="@+id/notesLayoutManagerScrollView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#fffaaa"
    android:fillViewport="true"
    tools:context="com.gp.app.professionalpa.layout.manager.NotesLayoutManagerActivity">

<LinearLayout 
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/notesLayoutManagerParentLinearLayout"
    android:orientation="horizontal"
    android:background="#ffffff"
    android:baselineAligned="false">

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="0dip"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:layout_weight="1"
        android:layout_marginRight="1dip"
        android:background="#ffffff">
    </LinearLayout>

    <LinearLayout
        android:id="@+id/linearLayout2"
        android:layout_width="0dip"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:layout_weight="1"
        android:layout_marginLeft="1dip"
        android:background="#ffffff">
    </LinearLayout>
</LinearLayout>
</ScrollView>

with the above layout.xml code scroll bar does not appear when the content of the linear layout with ids "linearLayout1" and "linearLayout2" grow in size vertically.

Please suggest how can i bring scrollbar in my activity view when the size of "linearLayout1" and "linearLayout2" grows beyond parent size. I want single scroll bar for my complete activity view and not separate scroll bars for "linearLayout1" and "linearLayout2".


Aucun commentaire:

Enregistrer un commentaire