LinearLayout(动态) withLayoutParams (int , int) 变得不可见
当我设置布局参数时,文本复选框变得不可见。我希望这个可见。 评分此翻译: 感谢你的评分 不好 好
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);
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);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
用这个改变你的LayourParams..
检查这是否有帮助。
Change your LayourParams with this..
check if this helps.