Share the post "Android: Long EditText Short Button In RelativeLayout"
Do you want to accomplish a search form that looks like this?
The only possible way is to use RelativeLayout. I had no such luck with using a LinearLayout and it seems that it cannot be done using that so RelativeLayout is the way to go.
Check the XML code below.
|
1 2 3 4 5 6 7 8 9 10 11 |
<RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@color/white"> <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="@color/black" android:text="type something" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_toLeftOf="@+id/button" /> <Button android:text="CLICK" android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true"/> </RelativeLayout> |