In my Android application I have used a Switch Button. Is there anyway to hide text of switch button? For API level 21 there is an option to hide (android:showText), but I need to run it on lower level devices.
Here is my xml file:
<Switch
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="7dp"
android:background="@drawable/offbuttonbg"
android:textAppearance="@style/SwitchTextAppearance"
android:thumb="@drawable/switchselector" />
For lower version, to hide the text use
<Switch
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="7dp"
android:textOff=""
android:textOn=""
android:background="@drawable/offbuttonbg"
android:textAppearance="@style/SwitchTextAppearance"
android:thumb="@drawable/switchselector" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With