Adnan
Adnan

Reputation: 8729

Scroll Down layout with Background image

I want to implement scroll down layout with Background Image. I found a question about scroll down layout in android here. So, how can I implement scroll down layout[Relative layout] with a background image. Thanks.

Upvotes: 0

Views: 340

Answers (1)

Bishan
Bishan

Reputation: 15702

<?xml version="1.0" encoding="utf-8"?>
    <ScrollView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:fillViewport="true">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="@dimen/activity_vertical_margin"
            android:paddingLeft="@dimen/activity_horizontal_margin"
            android:paddingRight="@dimen/activity_horizontal_margin"
            android:paddingTop="@dimen/activity_vertical_margin"
            android:background="@drawable/background_image"
        >    
       </RelativeLayout>
    </ScrollView>

Upvotes: 1

Related Questions