is it possible to create a toggle button in Android that has an image but no text? Ideally it would look like this:
Can I replace the toggle text with an image
No, we can not, although we can hide the text by overiding the default style of the toggle button, but still that won't give us a toggle button you want as we can't replace the text with an image.
How can I make a normal toggle button
Create a file ic_toggle in your res/drawable folder
Here @drawable/ic_slide_switch_on & @drawable/ic_slide_switch_off are images you create.
Then create another file in the same folder, name it ic_toggle_bg
Now add to your custom theme, (if you do not have one create a styles.xml file in your res/values/folder)
This creates a custom toggle button for you.
How to use it
Use the custom style and background in your view.