【发布时间】:2015-11-05 22:40:26
【问题描述】:
我的 xml 中有一个 TableLayout,我可以在 TableLayout 中动态添加带有 TextViews 的 TableRow,但问题是,宽度和高度没有设置为我设置的值。
TableRow tr = new TableRow(this);
tr.setPadding(0, 10, 0, 0);
TextView labelTV = new TextView(this);
labelTV.setText(strWork);
labelTV.setTextColor(Color.parseColor("#D69E29"));
labelTV.setTextSize(16);
labelTV.setLayoutParams(new TableRow.LayoutParams(
130,
TableRow.LayoutParams.WRAP_CONTENT));
tr.addView(labelTV);
mTable.addView(tr);
【问题讨论】:
标签: android android-tablelayout tablerow