将进度条对准中心

问题描述 投票:-1回答:1

将进度条与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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
<RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="50dp"

        android:background="@drawable/topbar"/>
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"

        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:layout_marginStart="124dp"
        android:layout_marginTop="8dp"
        android:gravity="center"
        android:text="Education4fun"
        android:id="@+id/title"
        android:textColor="#D4EDFC"
        android:textFontWeight="20"
        android:textSize="25dp" />


    <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
        android:id="@+id/swipe"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/title"
        android:layout_marginTop="8dp">

        <WebView
            android:id="@+id/webview"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="50dp">

            <ProgressBar
                android:id="@+id/progressBar"
                style="?android:attr/progressBarStyle"

                android:layout_width="wrap_content"
                android:layout_height="wrap_content"

                android:indeterminateDrawable="@drawable/cpb_1">



            </ProgressBar>

        </WebView>


    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

</RelativeLayout>

图像指定了我的问题“图像指出了我的问题”“ >>

将进度条对齐以使android居中,图像指定了我的问题。我尝试无法将其设置在中心的任何人,请帮助我...] >>

<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/title"
android:layout_marginTop="8dp">
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="50dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:layout_gravity="center"
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminateDrawable="@drawable/cpb_1">
</ProgressBar>
</LinearLayout>
</WebView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
android progress-bar center
1个回答
0
投票
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/title"
android:layout_marginTop="8dp">
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="50dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:layout_gravity="center"
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminateDrawable="@drawable/cpb_1">
</ProgressBar>
</LinearLayout>
</WebView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
© www.soinside.com 2019 - 2024. All rights reserved.