Android 单选按钮被禁用
如果我创建一个复选框视图并调用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
@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