Android default Switch
have text and then Switch
on/off. I'm Expecting Switch
on/off and then text. Don't use another widgets like TextView
. How can i set Switch
right side text.
android.widget.Switch. A Switch is a two-state toggle widget. Users can drag the switch "thumb" back and forth to select either of two options or simply tap the switch to toggle between options. The text property controls the text of the switch label. The textOn and textOff properties control the text of the thumb.
Wrap it in another layout with no text value and add a textview. see my code:
<LinearLayout android:layout_width="match_parent" android:orientation="horizontal" android:paddingTop="10dp" android:paddingBottom="10dp" android:layout_height="wrap_content"> <Switch android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/reminder" /> <TextView android:layout_width="wrap_content" android:text="Meeting Reminders" android:layout_height="wrap_content" /> </LinearLayout>
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