进度条出现在布局的顶部中心,但我想将其与布局中心对齐。我也尝试了Stackoverflow上的其他答案,但它没有奏效。这里是布局:Android:在布局的中心设置圆形进度条
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:id="@+id/progressbar"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/dashboard_recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</RelativeLayout>
@Bansal REA问题。他已经申请了。 –