Actullay 我想要的只是有问题的标题。我想在 TableLayout 中为 ImageView 设置固定宽度和高度。我该怎么做?
这是我的代码:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.buddy_list);
TableLayout buddy_list_layout = (TableLayout)findViewById(R.id.buddy_list_layout);
TableRow tableRow = new TableRow(this);
tableRow.setLayoutParams(new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
ImageView imageView = new ImageView(this);
imageView.setImageResource(R.drawable.troll_logo);
//imageView.setLayoutParams(new TableLayout.LayoutParams(100, 100));
tableRow.addView(imageView);
buddy_list_layout.addView(tableRow);
} // end -> method -> onCreate