Saturday 11 August 2012

Messing with Scroll Views in android

The post is regarding the usage of scroll views in android.The layout for the same is as below.
--------------------------------------------------------------------------------------------------
<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" >

    <ScrollView
        android:id="@+id/tc_termsConditions"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/tc_buttoncontainer" >

        <RelativeLayout
            android:id="@+id/tc_textHolder"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:id="@+id/tc_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:text="@string/tc_title"
                android:textSize="20sp"
                android:textStyle="bold"
                android:typeface="serif" >
            </TextView>

            <TextView
                android:id="@+id/tc_description"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/tc_title"
                android:fitsSystemWindows="false"
                android:singleLine="false"
                android:text="@string/tc_content_description" />
        </RelativeLayout>
    </ScrollView>

    <LinearLayout
        android:id="@+id/tc_buttoncontainer"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/tc_btn_decline"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:text="@string/btn_decline"
            android:textSize="15dip"
            android:typeface="monospace" />

        <Button
            android:id="@+id/tc_btn_accept"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:text="@string/btn_accept"
            android:textSize="15dip"
            android:typeface="monospace" />
    </LinearLayout>

</RelativeLayout>
----------------------------------------------------------------------------------------------------------

No comments:

Post a Comment

Note: only a member of this blog may post a comment.