I have a custom style for a switch widget in my app. There is text for both, textOff and textOn. The text that is shown is short in English, but unfortunately long or even contains more than one word in other languages and therefore does not fit into the widget. This causes the widget's drawable be pushed out of the widget's visible area and sometimes the switch button itself does not fit in.
(unfortunately I cannot post images due to lack of reputation)
I want the text to be wrapped if the text does not fit anymore. Is this possible? I tried singleLine="false" as well as the ellipsize attribute and both do not show any effect.
<Switch
style="@style/MarginedElement"
android:id="@+id/toggle_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/toggle_switch"
android:textOff="@string/textOff"
android:textOn="@string/textOn"
android:thumb="@drawable/click_style_switch_button_thumb"
android:track="@drawable/click_style_switch_button_bg"
android:background="@drawable/click_style_switch_bg"
android:switchTextAppearance="@style/switchText"
/>
Any idea how I could go about this? Or alternative solutions besides changing the text itself.
EDIT: Fixing the switch's width, setting singleLine="true" and ellipsize="end" does not have any effect.