Reputation: 447
I have a problem with Switch controls. They are not correctly displayed on some devices. Please see the following image:
And it's code:
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Switch
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Full screen"
android:id="@+id/optionFullscreen"
android:layout_margin="10dp"
android:onClick="onOptionBtClick"
android:checked="false" />
</LinearLayout>
Could you please help, is it possible to make this ON/OFF trigger max width not take more than about 40%?
Upvotes: 0
Views: 137
Reputation: 447
The problem was with long texts. I solved it by setting my own text:
android:textOn="I"
android:textOff="O"
Upvotes: 1
Reputation: 1751
You can set the android:switchMinWidth="50dp"
attribute on your switch widget. that will make it smaller
Upvotes: 0