【发布时间】:2018-11-07 00:35:36
【问题描述】:
TableLayout mTableLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mTableLayout = findViewById(R.id.table_layout);
mTableLayout = new TableLayout(this);
ImageView imageView = new ImageView(this);
imageView.setImageResource(R.drawable.black);
TableRow tableRow = new TableRow(this);
tableRow.addView(imageView);
mTableLayout.addView(tableRow);
我想将图像视图添加到表格行,然后将此表格行添加到表格布局。 但是当这个运行时,屏幕什么也没有发生。我不知道为什么。 我试图找到 Logcat 和断点,但没有错。
【问题讨论】:
标签: android tablelayout tablerow