Question

Please help me two add the scroll view behind the button (i.e) scrolling starting from the half button on wards please help me how to design

Was it helpful?

Solution

Try this code,scroll view is from half way from button to onwards, lot of TextView are for checking scroll View.

<RelativeLayout 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:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >

    <ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_alignTop="@+id/button1"
        android:layout_marginLeft="22dp"
        android:layout_marginTop="20dp" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/textView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Large TextLarge TextLarge TextLarge 
                Large TextLarge TextLarge TextLarge TextLarge Text
                Large TextLarge TextLarge TextLarge TextLarge Text
                Large TextLarge TextLarge TextLarge TextLarge Text
                Large TextLarge TextLarge TextLarge TextLarge Text
                Large TextLarge TextLarge TextLarge TextLarge Text
                Large TextLarge TextLarge TextLarge TextLarge Text
                Large TextLarge TextLarge TextLarge TextLarge Text
                Large TextLarge TextLarge TextLarge TextLarge Text
                Large TextLarge TextLarge TextLarge TextLarge Text
                Large TextLarge TextLarge TextLarge TextLarge Text
                Large TextLarge TextLarge TextLarge TextLarge Text
                Large TextLarge TextLarge TextLarge TextLarge Text
                Large TextLarge TextLarge TextLarge TextLarge Text
                Large TextLarge TextLarge TextLarge TextLarge Text
                Large TextLarge TextLarge TextLarge TextLarge Text"
                android:textAppearance="?android:attr/textAppearanceLarge" />
        </LinearLayout>
    </ScrollView>

    <Button
        android:id="@+id/button1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/scrollView1"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="39dp"
        android:layout_marginRight="39dp"
        android:background="#ffff55"
        android:text="Button" />

</RelativeLayout>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top