私はまさに私が望むことを行うXMLのテーブルレイアウトを持っています:
<TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/evenrow">
<TextView android:text="Check" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_weight="1"></TextView>
プログラムでテーブル行を追加しようとしていますが、layout_weight セットを取得できないようです。Javaコードは次のとおりです。
TableRow.LayoutParams trlayout = new TableRow.LayoutParams (TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT, 1);
TableLayout.LayoutParams tablelayout = new TableLayout.LayoutParams (TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.FILL_PARENT);
TableRow tr = new TableRow(this);
tr.setLayoutParams(trlayout);
TextView check = new TextView(this);
check.setText(String.format("%5.2f", i));
tr.addView(check);
new TableRow.LayoutParams の 3 番目のパラメーターが行の子のデフォルトの重みだと思っていましたが、機能していません。私は何が欠けていますか?