How to change toggle button text in android
To perform this using java,use the following :
// Sets the text for when the button is not in the checked state.
toggleButton.setTextOff(textOff);
// Sets the text for when the button is in the checked state.
toggleButton.setTextOn(textOn);
To set the text using xml, use the following:
android:textOff="The text for the button when it is not checked." android:textOn="The text for the button when it is checked."
Click here to subscribe my YouTube Channel.
--------------------
Regards
Shankha Jana
No comments