I want to align those inputs to have two autocomplete box on the right, on a smaller button on their right. However I end up with a large autocomplete (second one) covering everything.
<RelativeLayout
android:layout_alignParentBottom="true"
android:id="@+id/transport_search"
android:background="@color/dark_grey"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<AutoCompleteTextView
android:id="@+id/transport_autoCompleteFrom"
android:layout_width="fill_parent"
android:layout_weight="5"
></AutoCompleteTextView>
<Button
android:id="@+id/transport_switchDirection"
android:layout_toRightOf="@+id/transport_autoCompleteFrom"
android:layout_width="fill_parent"
android:layout_weight="1"
></Button>
<AutoCompleteTextView
android:id="@+id/transport_autoCompleteTo"
android:layout_width="fill_parent"
android:layout_weight="5"
></AutoCompleteTextView>
<Button
android:id="@+id/transport_go"
android:layout_toRightOf="@+id/transport_autoCompleteTo"
android:layout_width="fill_parent"
android:layout_weight="1"
></Button>
</RelativeLayout>
What am I doing wrong?
You can use LinearLayout inside RelativeLayout. Below shows two buttons in line: