4

Currently my SwitchCompat looks like the image below (the top portion), however I need to have visible text in OFF state.

How would I achieve this?

switch compat image


Johan
  • 8,068
  • 1
  • 33
  • 46
NickUnuchek
  • 11,794
  • 12
  • 98
  • 138

2 Answers2

0

Are you using background images? if it does you need set text on images not on switch.

Iatsenko Anton
  • 157
  • 1
  • 6
0
  <android.support.v7.widget.SwitchCompat
        android:id="@+id/autoLocation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:background="@color/colorPrimary"
        android:checked="false"
        android:paddingBottom="10dp"
        android:paddingLeft="20dp"
        android:paddingRight="20dp"
        android:paddingTop="10dp"
        android:text="@string/autoLocation"
        android:textColor="#ffffff"
        android:textOff="Off"
        android:textOn="On"
        android:textSize="20sp"
        app:showText="true" />