I have an AutoCompleteTextView and an indeterminate progress bar in a relative layout.
The problem I now have is that if text displayed is long enough, it is put in the background of the progress bar.
How can I prevent this?
This is the relevant xml code:
<RelativeLayout
android:id="@+id/AddressContainer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/SearchBtn"
>
<AutoCompleteTextView
android:id="@+id/SearchField"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:lines="1"
android:singleLine="true"
android:layout_marginRight="2dp"
android:layout_marginLeft="2dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="0dp"
>
</AutoCompleteTextView>
<ProgressBar
android:id="@+id/progressBar1"
style="@style/Widget.ProgressBar.Medium"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingRight="8dp"
/>
</RelativeLayout>
Try this changes so the
AutoCompleteTextViewand ProgressBar` don’t overlap:Edit:
Now I’ve seen that picture, if you want the text to not go under the
ProgressBarsimply add some right padding to yourAutoCompleteTextViewlike: