ホームに戻る
 テキストビュー

package org.example.test;

import android.app.*;
import android.graphics.*;
import android.os.*;
import android.view.*;
import android.widget.*;

public class TextView extends Activity
{
    public void onCreate(Bundle savedInstanceState)
    {
      super.onCreate(savedInstanceState);

      LinearLayout ll = new LinearLayout(this);
      ll.setOrientation(LinearLayout.VERTICAL);
      setContentView(ll);

      TextView tv = new TextView(this);
      tv.setText("test text");
      tv.setTextColor(Color.RED);
      tv.setBackgroundColor(Color.WHITE);
      tv.setTextSize(50);
      tv.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.NORMAL));
      tv.setGravity(Gravity.CENTER | Gravity.BOTTOM);

      ll.addView(tv);
    }
}

inserted by FC2 system