I created a RelativeLayout
with a button and a circular ProgressBar. Here's how:
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<Button
android:id="@+id/btnLogin"
android:theme="@style/ButtonStart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/login" />
<ProgressBar
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="14dp"
android:layout_marginStart="14dp"
android:id="@+id/progressBar4"/>
</RelativeLayout>
Regardless of the order, first entering Button
and then ProgressBar
, vice versa, after the compiled project, ProgressBar
is always behind the button. Why does ProgressBar
hide behind the button? What is the best way to solve this problem?