I have this layout,
<TableLayout android:stretchColumns="0"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableRow>
<AutoCompleteTextView
android:id="@+id/StationTextView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:completionThreshold="2"
android:inputType="textAutoComplete"
android:imeOptions="flagNoExtractUi|actionSearch" />
<Button android:id="@+id/ShowTimesButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_btn_search" />
</TableRow>
</TableLayout>
from the start everything is as I want it to be, e.g. the textview takes upp all space that the button does not take. But if the textview gets filled with a long string it pushes the button off the screen, I want the layout to be constraind within the screen and never push things off the screen. How can I do this?
try use weight in your layout: