我是 android 编程新手,我遇到了一个问题。这是代码片段
nums = (GridView) findViewById(R.id.nums);
for(int i=0; i < 10; i++) {
Button b = new Button(this);
b.setText(i+"");
b.setTextSize(15);
b.setTextColor(Color.CYAN);
b.setOnClickListener(numsClickHandler);
nums.addView(b, 20, 20);
}
当它到达时出现问题nums.addView(b, 20, 20);
caused by: java.lang.unsupportedoperationexception: addView(View, int, layoutparams) is
not supported in adapterview