I am trying to add switch widget in my layout. Problem i am encountering is widget appears on the right side living a space for its text(but i don't want any text. it appears like this.
but what i want is
I had tried a few ways like using nested layouts( it works well for small screen but when i try it on tabs then due to large screen it acquire more space and ultimately it shifts slightly toward right leaving space for text even though i did't entered any text).
the xml code i am currently using
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:orientation="horizontal"
android:weightSum="11">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"></LinearLayout>
<Switch
android:id="@+id/sosswitch"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:text="" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"></LinearLayout>
</LinearLayout>
I am using the above code to bring the switch in middle but it still create problem in large screens.
