我想在GridLayout上进行row_span操作,并在该跨区域添加一个按钮。视图应覆盖整个区域。但我无法实现我的目标。有谁可以帮助我?
这是我的代码
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.schedule);
g =(GridLayout)findViewById(R.id.grid);
Button b = new Button(this);
GridLayout.LayoutParams layoutParams = new GridLayout.LayoutParams();
layoutParams.rowSpec = GridLayout.spec(3,5,112);
g.addView(b,layoutParams);
}