In default mode , text of a Switch
sit on the left side of ON/OFF states. I want to change direction of this text to the right slide. How can i do
You can use this:
android:layoutDirection="rtl"
AFAIK thats not doable, you can try the following
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Switch
android:id="@+id/switch_gprs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:paddingBottom="15dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:paddingBottom="15dp"
android:layout_toRightOf="@+id/switch_gprs"
android:text="sometext"/>
</RelativeLayout>
Or you can do :
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Switch
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="My Switch"/>
</LinearLayout>