Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - how to make a switch bigger?

Here's my switch in xml:

<Switch
    android:id="@+id/mySwitch"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:textOff="OFF"
    android:textOn="ON" />

I cannot find a property in <switch> to make the switch bigger, what I tried so far:

android-textSize, controls the description size that is located right next to the switch, not the switch ON/OFF itself

android:switchMinWidth, controls the width of each switch's component (ON/OFF)

I simply want my switch to be bigger, and the text ON and OFF also take effects of the switch getting bigger.

Is there a property I missed?

like image 536
Hendra Anggrian Avatar asked Nov 05 '13 09:11

Hendra Anggrian


1 Answers

Try this solution.

Add these lines to your tag in xml file.

android:scaleX="2"
android:scaleY="2"
like image 161
Gaurav Avatar answered Sep 27 '22 20:09

Gaurav