0

When I set layout params text checkbox go invisible. I'd Like This visible. Thank Y

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);
user1211927
  • 61
  • 1
  • 3

1 Answers1

0

Change your LayourParams with this..

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

check if this helps.

Deepak
  • 1,989
  • 1
  • 18
  • 20