FileDocCategorySizeDatePackage
ScrollView2.javaAPI DocGoogle Android v1.5 Example1726Sun Nov 11 13:01:04 GMT 2007com.google.android.samples.view

ScrollView2

public class ScrollView2 extends android.app.Activity
Demonstrates wrapping a layout in a ScrollView.

Fields Summary
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);
        setContentView(R.layout.scroll_view_2);

        LinearLayout layout = (LinearLayout) findViewById(R.id.layout);
        for (int i = 2; i < 64; i++) {
            TextView textView = new TextView(this);
            textView.setText("Text View " + i);
            LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(
                    LinearLayout.LayoutParams.FILL_PARENT,
                    LinearLayout.LayoutParams.WRAP_CONTENT
            );
            layout.addView(textView, p);

            Button buttonView = new Button(this);
            buttonView.setText("Button " + i);
            layout.addView(buttonView, p);
        }