If you want to keep the layout the same (i.e. buttons after the text), use the layout_weight property along with fill_parent , thus:
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <EditText android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content"> </EditText> <ImageButton android:src="@drawable/img1" android:layout_width="50dip" android:layout_height="50dip"> </ImageButton> <ImageButton android:src="@drawable/img2" android:layout_width="50dip" android:layout_height="50dip"> </ImageButton> </LinearLayout>
Providing an EditText 'weight' makes him think last and gives buttons an edge. Play with different layout_weights and see how much fun you can have!
Hieronymus Mar 23 2018-11-11T00: 00Z
source share