要在表格布局中设置文本到行中,你可以按照以下步骤进行操作:
TableLayout tableLayout = findViewById(R.id.tableLayout);
TableRow tableRow = findViewById(R.id.tableRow1);
TextView textView = findViewById(R.id.textView1);
// 设置文本
textView.setText("新的文本");
// 可以通过以下方式将TextView添加到TableRow中
tableRow.addView(textView);
// 将TableRow添加到TableLayout中
tableLayout.addView(tableRow);
这样,你就可以在表格布局中的行中设置文本了。你可以根据需要重复上述步骤来添加更多的行和设置文本。
下一篇:表格布局没有完全显示