0

当我设置布局参数文本复选框时不可见。我希望这个可见。谢谢你

LayoutParams lparams = new LayoutParams(30, 60);
                        LinearLayout layoutCb = new LinearLayout(this);
                        CheckBox checkbox = new CheckBox(this);
                        checkbox.setHeight(30);
                        checkbox.setGravity(Gravity.CENTER);
                        int cbnum = coluna+1;
                        checkbox.setTag("CbCargaNotasL"+cbnum);
                        checkbox.setWidth(37);
                        checkbox.setButtonDrawable(R.drawable.checkbox);
                        layoutCb.setGravity(Gravity.RIGHT);
                        layoutCb.setLayoutParams(lparams);
                        layoutCb.addView(checkbox);
                        layoutCb.setBackgroundResource(R.drawable.border);
                        LinhaTabela.setGravity(Gravity.RIGHT);
                        LinhaTabela.addView(layoutCb);
4

1 回答 1

0

用这个改变你的 LayourParams..

LinearLayout.LayoutParams btnParams = new LinearLayout.LayoutParams(
                LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

检查这是否有帮助。

于 2012-02-15T17:15:10.510 回答