xml:
<?xml version="1.0" encoding="utf-8" ?>
<TableLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
android:rowCount="10"
android:columnCount="4"
android:id="@+id/mainwindow"

>    <TextView
        android:id="@+id/show"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:scrollbars="vertical"
        android:singleLine="false"
        android:textSize="50sp"
        android:layout_gravity="right"
        android:background="#000"
        android:textColor="@color/red"
        android:gravity="right"
        />
</TableLayout>java:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.calculator); tableLayout = (TableLayout) findViewById(R.id.mainwindow);
text = (TextView) findViewById(R.id.show);
text.setMovementMethod(ScrollingMovementMethod.getInstance());
text.setLines(2);
Button[] bn = new Button[20]; tableLayout.setStretchAllColumns(true);
tableLayout.setShrinkAllColumns(true); int n = 0;
for (int i = 0; i < 5; i++) {
TableRow textrow = new TableRow(this);
for (int j = 0; j < 4; j++) {
bn[n] = new Button(this);
bn[n].setText(chars[n]);
bn[n].setTextSize(30);
TableRow.LayoutParams lp = new TableRow.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
textrow.addView(bn[n], lp);
n++;
}
tableLayout.addView(textrow);
}
}请问下如何让android程序自动适应各种屏幕大小,这个程序在虚拟机上可以自动适应屏幕大小,但是一安装到手机上面就不能自动适应屏幕大小