我以编程方式创建了GridLayout
3x3。
我需要用5 RadioButtons
填充它,如下所示:
0 1 2
0 O O
1 O
2 O O
但在我的应用程序中我有这样一个:
0 1 2
0 O
1 O
2 O
下面是我用来创建Buttons
的代码
Spec FieldRowParam = GridLayout.spec(FieldRow);
Spec FieldColumnParam = GridLayout.spec(FieldColumn);
GridLayout.LayoutParams Params = new GridLayout.LayoutParams(FieldRowParam, FieldColumnParam);
btnNew = new RadioButton(this);
FieldLayout.addView(btnNew,Params);
我在int FieldRow
和int FieldColumn
中使用的坐标
0-0;1-1;2-2;0-2;2-0。
具有0-0和0-2坐标的按钮合并为1按钮,2-2和2-0按钮.
我认为按钮之间的空白处的问题,但我不能解决它。谢谢你的回答!
发布于 2014-04-16 12:28:57
只需在所有地方添加RadioButton
,并在不需要RadioButton
时设置可见性RadioButton
https://stackoverflow.com/questions/23108213
复制相似问题