I have a Button that is defined in a RelativeLayout as follows:
<Button
android:id="@+id/search_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/current_location"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:paddingBottom="30dp"
android:paddingTop="30dp"
android:text="@string/search" />
I would like to add a ProgressBar behind the Button that occupies the exact same space as the Button, so that when the button is disabled (translucent), you can see the progress bar behind it. How would I do this?
To do this I had to define the button in my
main.xmlfirst, followed by the progress bar as follows:Then, once I had initialized all the GUI components, I had to bring the button back in front of the progress bar with:
The end result
Button when enabled:
Button when disabled with progress bar: