Android 动态往 RadioGroup 添加 RadioButton
发布日期:2022-02-26 14:49:31
浏览次数:49
分类:技术文章
本文共 835 字,大约阅读时间需要 2 分钟。
RadioButton radioButton = new RadioButton(context); radioButton.setText(data1.get(i).getName()); ViewGroup.LayoutParams layoutParams = new RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 100); ((RadioGroup.LayoutParams) layoutParams).setMargins(0, 10, 0, 0); radioButton.setLayoutParams(layoutParams); radioButton.setGravity(Gravity.CENTER); radioButton.setTag(data1.get(i).getCid()); radioButton.setBackgroundResource(R.drawable.classfiy_left_radiobutton_selector); radioButton.setButtonDrawable(new BitmapDrawable((Resources) null)); classify_left_radiogroup.addView(radioButton);
下面这两种都是去掉RadioButton小圆点的方法
Bitmap a = null;radioButton.setButtonDrawable(new BitmapDrawable(a));radioButton.setButtonDrawable(new BitmapDrawable((Resources) null));
这样就好了~四不四很简单? 试试吧 大概是这样的把~
转载地址:https://blog.csdn.net/qq_31353347/article/details/84339372 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
不错!
[***.144.177.141]2024年04月24日 13时01分02秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
MFC单文档(SDI)转换成多文档(MDI)解决方案
2019-05-09
15个Google面试题,看看自己能答对几个,看你是否真的聪明。。。
2019-05-09
Linux/Ubuntu下安装VMWare Tools
2019-05-09
循环移位 - 修订版
2019-05-09
Linux/Ubuntu下的用户切换
2019-05-09
vi command summary
2019-05-09
博弈——多人Nash 平衡
2019-05-09
双边滤波器的原理及实现
2019-05-09
距离变换
2019-05-09
图像傅里叶变换
2019-05-09
图像拉普拉斯金字塔融合(Laplacian Pyramid Blending)
2019-05-09
OpenCV基本数据类型
2019-05-09
DoG (Difference of Gaussian)角点检测
2019-05-09
SIFT特征提取分析
2019-05-09
多种特征提取算法比较汇总
2019-05-09
特征提取方法 SIFT,PCA-SIFT,GLOH,SURF
2019-05-09
MATLAB数据处理快速学习教程
2019-05-09
追踪Google I/O动向——Google I/O 2012 有哪些亮点?
2019-05-09
解决Opencv高低版本不兼容问题
2019-05-09