Android 单选按钮被禁用

发布于 2024-08-31 04:18:16 字数 91 浏览 2 评论 0原文

如果我创建一个复选框视图并调用 setEnabled(false),则复选框外观呈灰色,但如果我创建一个单选按钮,则视图处于非活动状态,但不会呈灰色。 有什么想法吗?

If I create a checkbox view and call setEnabled(false), the checkbox look is grayed but if I create a radiobutton, the view is inactive but it is not grayed.
Any idea ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笛声青案梦长安 2024-09-07 04:18:16

@Arutha我认为你错了,我尝试创建一个复选框和1个单选按钮,它们一开始都是灰色的,当我们检查复选框被选中时,它会变成绿色并且可以取消选中,但单选按钮一次检查它不能被取消选中,除非我们为此编写一个函数。我相信这会解决您的问题,如果答案不适合问题,请用代码详细说明问题。

请查看链接: http://www.androidpeople.com/android-radiobutton-示例

@Arutha I think you are somewhere wrong, I tried by creating a 1 checkbox and 1 radio button both are grey at the beginning, when we check the check box is selected it changes to green and it can be unchecked, but the radio button once checked it cannot be unchecked unless we rite a function for that. I believe this will clear your problem, If the answer dose't fit to the question please elaborate the question with the code.

Please have a look in to the link: http://www.androidpeople.com/android-radiobutton-example

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文