<LinearLayout android:layout_width="match_parent" android:layout_height="fill_parent" android:weightSum="4" android:orientation="horizontal" > <Button android:id="@+id/buttonToastSimple" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="English Toast" /> <Button android:id="@+id/buttonToastFancy" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="3" android:text="French Toast" /> </LinearLayout>
try setting the desired 0dp attribute ..
ex. if you set the weight to support the width, use android:layout_width="0dp" along with android:layout_weight="3" . Also, don't forget android:weightSum="4" in the parent.
Ahmed Ekri
source share