Is there anyway to disable tapping on the text of a Switch
? Currently it toggles the switch which I don't want.
I'm setting my switch text like messageSwitch.setText("Messaging Enabled");
. This makes the entire switch view receiving taps of the event. Is there any way to disable this?
In your xml, just set it like this:
or this might be better
Setting the enabled option to false disables both the text and the switch itself. You can do all of this programatically as well.