android - How to set minimum width on a LinearLayout element when using weightSum and layout_weight -
i set width of linearlayout's childs percentages of layout.
it displays fine on 7 , 10 inches screens, on 5 inches, given percentage yields width small text.
the child's minwidth attribute ignored.
how can set minimum width on child ?
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout_file_seek_bar" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="60dp" android:layout_margintop="10dp" android:weightsum="100" android:gravity="center_vertical"> <textview android:id="@+id/textview_file_playing_time" android:layout_width="0dp" android:layout_weight="8" android:minwidth="100dp" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancelarge" android:textcolor="#ffffff" android:text="00:00" android:layout_marginleft="15dp" /> <seekbar android:id="@+id/seek_bar_source_file" android:layout_width="0dp" android:layout_weight="92" android:layout_height="40dp" android:indeterminate="false" /> </linearlayout>
this should work
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout_file_seek_bar" android:layout_width="match_parent" android:layout_height="60dp" android:layout_margintop="10dp" android:gravity="center_vertical" android:orientation="horizontal" android:weightsum="100" > <textview android:id="@+id/textview_file_playing_time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginleft="15dp" android:maxwidth="100dp" android:text="00:00" android:textappearance="?android:attr/textappearancelarge" android:textcolor="#000000" /> <seekbar android:id="@+id/seek_bar_source_file" android:layout_width="0dp" android:layout_height="40dp" android:layout_weight="92" android:indeterminate="false" /> </linearlayout>
Comments
Post a Comment