wrap View In ScrollView - Android User Interface

Android examples for User Interface:ScrollView

Description

wrap View In ScrollView

Demo Code


//package com.java2s;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ScrollView;

public class Main {
    public static View wrapInScrollView(View rootView, Context context) {
        ScrollView scrollView = new ScrollView(context);
        scrollView.setLayoutParams(new ViewGroup.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT));

        scrollView.addView(rootView);//from   www  .j  av a2 s.c om
        return scrollView;
    }
}

Related Tutorials