【发布时间】:2021-11-08 13:52:06
【问题描述】:
我想在 API 调用期间在我的屏幕上显示一个进度条。如下创建了 API,但一旦可见,它就会显示在按钮/文本字段的后面。如果屏幕上没有项目,则它是完全可见的。如果有按钮或按钮后面显示的东西。所以我不能正确地看到它。如果实施有任何问题,请告诉我。
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/window_layout"
android:background="@color/white"
>
<FrameLayout
android:id="@+id/linearLayout5"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/progress_linear"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ProgressBar
style="?android:attr/progressBarStyleInverse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
android:theme="@style/ProgressBarTheme"
android:id="@+id/progress"
android:layout_gravity="center" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="MissingConstraints">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dip"
android:text="@string/txt_setup"
android:layout_marginBottom="16dp"
/><RelativeLayout
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_marginTop="8dp"
android:id="@+id/spinner_layout"
android:background="@drawable/spinner_back"\>
<Spinner
android:id="@+id/spinner"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:dropDownWidth="match_parent"
android:dropDownVerticalOffset="40dp"
android:background="@android:color/transparent"
android:spinnerMode="dropdown" />
<ImageView
android:id="@+id/spinner_arr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic__2_web_icons_ic_caretdown_gra"/>
</RelativeLayout>
</LinearLayout>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
【问题讨论】:
标签: android android-layout android-progressbar android-loader