Code example for ScrollView

Methods: addView

0
public class TextPathActivity extends Activity {
    @Override 
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        ScrollView scroller = new ScrollView(this);
        scroller.addView(new CustomTextView(this));
        setContentView(scroller);
    } 
 
    static class CustomTextView extends View {
        private final Paint mHugePaint;
 
        CustomTextView(Context c) {
            super(c);
 
            mHugePaint = new Paint();
            mHugePaint.setAntiAlias(true);
            mHugePaint.setColor(0xff000000);
            mHugePaint.setTextSize(300f);
        }