有谁知道是否可以在 Android 中向 TableLayout 添加列?我需要在表格中显示相对大量的数据。显然,这不应该全部显示在一列中。
您可以通过创建 TableRow()-Object 来添加行。此外,还有一些 xml 参数,但我不知道如何通过 Java 代码访问它。
TextView val = new TextView(this);
val.setText(args.get(i));
table.addView(val);
table.addView(tr,new TableLayout.LayoutParams(
LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
我无法在对我有用的 TableRow.LayoutParams 中找到匹配的值。但可能我试图以错误的方式使用它。
table.addView(val,new TableRow.LayoutParams(
LayoutParams. ?? ));