开发者

Checkbox label should not be clickable

开发者 https://www.devze.com 2023-03-10 11:24 出处:网络
I am using checkb开发者_StackOverflow中文版ox in android and the state of checkbox is changing once i click on the text of the checkbox. \"[CB]Text \". Is there any way to change this behaviour so tha

I am using checkb开发者_StackOverflow中文版ox in android and the state of checkbox is changing once i click on the text of the checkbox. "[CB] Text ". Is there any way to change this behaviour so that the state of checkbox will be changed once i click on the box and not the text.

Sorry this question would have already asked in the forum. But i was not able to find any queries related to this. Any suggestions would be really helpful for me.

-Thanks, Ron...


The answer by jkhouw1 is the only way I can think of as well.

But please take a moment to make sure you really want this functionality. Every time you change the basic behavior of a, to the user, well know element you confuse more than you help. There are cases where you need such a change, but take a minute to make sure this is so!


Other than creating your own control, the easiest way would probably be to not display any text with the checkbox and in your layout use a textview for the text instead so you would have

[CB][TextView]


I think you are using [checkbox] [textview] in one layout tht is linear or relative,if i am right then set android:focusable = "false" android:clickable= "true" to checkbox.

i hope it will help you.

0

精彩评论

暂无评论...
验证码 换一张
取 消