package jp.javadrive.android; import android.app.Activity; import android.os.Bundle; import android.widget.LinearLayout; import android.view.ViewGroup; import android.widget.TextView; public class Test06_01 extends Activity { private final int WRAP_CONTENT = ViewGroup.LayoutParams.WRAP_CONTENT; @Override protected void onCreate(Bundle icicle) { super.onCreate(icicle); LinearLayout linearLayout = new LinearLayout(this); linearLayout.setOrientation(LinearLayout.VERTICAL); setContentView(linearLayout); TextView tv1 = new TextView(this); tv1.setText("abcdef 0.5f"); tv1.setTextScaleX(0.5f); linearLayout.addView(tv1, new LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)); TextView tv2 = new TextView(this); tv2.setText("abcdef 1.0f"); tv2.setTextScaleX(1.0f); linearLayout.addView(tv2, new LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)); TextView tv3 = new TextView(this); tv3.setText("abcdef 1.5f"); tv3.setTextScaleX(1.5f); linearLayout.addView(tv3, new LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)); TextView tv4 = new TextView(this); tv4.setText("abcdef 2.0f"); tv4.setTextScaleX(2.0f); linearLayout.addView(tv4, new LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)); } }