5

guys! I have a question :) trying to customize a switch a little bit, such as the outline of the switch will have a border, and the inside part of it, the one you click to activate the event, also with a border, but in a way that it won't overlap the outline border of the switch. Since I don't have enough rep, I can't actually post the picture, therefore I hope it is clear enough :) what I got so far is:

<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
    <size android:height="50dp"/>
    <corners
        android:radius="3dp"/>

    <stroke
        android:width="2dp"
        android:color="@color/wampRed"/>

</shape>


<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/wampRed"/>
    <corners
        android:radius="2dp"/>


</shape>

<

Switch
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/switchButton"
        android:layout_marginBottom="40dp"
        android:textOn=""
        android:thumb="@drawable/shape_track"
        android:track="@drawable/shape_thumb"
        android:layout_marginRight="5dp"
        android:textOff="       "
        android:layout_alignParentBottom="true"
        android:layout_toRightOf="@+id/dateOutput"

        />

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.