这是我的代码的一部分,它必须显示包含多个项目的表格视图,但它没有显示任何内容。
TableLayout tableView = (TableLayout) findViewById(R.id.tableLayoutUsers);
TableRow tr = new TableRow(this);
LayoutParams rowLayoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
tr.setLayoutParams(rowLayoutParams);
TextView name = new TextView(this);
name.setText(userClass.getUsername());
LayoutParams dateLayParam = new LayoutParams(LayoutParams.WRAP_CONTENT); // , LayoutParams.FILL_PARENT);
name.setLayoutParams(dateLayParam);
tr.addView(name);
tableView.addView(tr, new TableLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
tr.setClickable(true);
有什么问题?谢谢