
Android 动态往 RadioGroup 添加 RadioButton
发布日期:2022-02-26 14:49:31
浏览次数:29
分类:技术文章
本文共 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]2023年05月18日 01时08分31秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
最新文章
lego_loam——featuerAssociation.cpp
2022-09-10
lego-loam运行报错
2020-07-07 02:33:37
lego-loam运行常见错误
2020-07-07 02:33:06
LeGO-LOAM 系列(3): featureAssociation node 分析
2020-07-07 02:32:36
legend3---lavarel常用操作代码2
2020-07-07 02:32:06
leftlet 使用font-awesome图标 并进行旋转
2020-07-07 02:31:36
LeftJoin RightJoin
2020-07-07 02:31:05
left join(二)
2020-07-07 02:30:35
left join(一)
2020-07-07 02:29:56
left join左连接匹配数据为NULL时显示指定值
2020-07-07 02:29:25
left join 和 group by 一起使用
2020-07-07 02:28:55
left join on 后面 and 用法
2020-07-07 02:28:25
left , right , inner , 区别
2020-07-07 02:27:54
Lee滤波和Refine-Lee滤波
2020-07-07 02:27:24
lee必刷(六)160 相交链表、169 求众数、198 打家劫舍、200 岛屿个数、207 课程表(图 bfs、dfs)、208 实现trie(前缀树)、数组中的第k个最大元素、最大正方形、回文链表
2020-07-07 02:26:54
lee上有趣题目
2020-07-07 02:26:24
Leetcoe224 计算器
2020-07-07 02:25:54
leetcod刷题计划Day11
2020-07-07 02:25:23
LeetCode:面试题 01.03. URL化
2020-07-07 02:24:44
LeetCode:剑指 Offer 62. 圆圈中最后剩下的数字
2020-07-07 02:24:14