Android Studio-ProgressBar将不会渲染

Android Studio-ProgressBar将不会渲染,android,android-studio,Android,Android Studio,我试图在布局中使用progressbar。我不明白为什么它不会出现。它不会显示在我的预览中,当我在实际手机上运行应用程序时也不会显示。你知道为什么会这样吗 以下是我的布局XML: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.a

我试图在布局中使用progressbar。我不明白为什么它不会出现。它不会显示在我的预览中,当我在实际手机上运行应用程序时也不会显示。你知道为什么会这样吗

以下是我的布局XML:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:background="#283341"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:showIn="@layout/activity_startup" tools:context=".StartupActivity">

    <ImageView
        android:id="@+id/startupImg"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="50dp"
        android:layout_marginTop="150dp"
        android:layout_centerInParent="true"
        android:src="@drawable/q_orange" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerInParent="true"
        android:layout_marginBottom="30dp">

        <ProgressBar
            android:id="@+id/loadingSpinner"
            style="?android:attr/progressBarStyleSmall"
            android:layout_centerInParent="true"
            android:layout_width="33dp"
            android:layout_height="33dp"
            android:visibility="visible"
            android:indeterminate="true"
            />

        <TextView
            android:id="@+id/startupStatus"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:text="Loading..."
            android:textColor="#ff8a07"
            android:textSize="25sp" />
    </LinearLayout>

</RelativeLayout>


为progressbar设置

android:layout_width="100dp"
android:layout_height="wrap_content"

设置进度条

android:layout_width="100dp"
android:layout_height="wrap_content"

试试这个,让我知道它是否有效:

     <ProgressBar
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     style="@android:style/Widget.ProgressBar.Small"
     android:layout_marginRight="5dp" />

试试这个,让我知道它是否有效:

     <ProgressBar
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     style="@android:style/Widget.ProgressBar.Small"
     android:layout_marginRight="5dp" />



仍然做同样的事情布局\u宽度改变同样的事情。只显示那个红点。不过我没有收到任何错误。我的截图没有撒谎。我想知道我是否需要重新安装我的SDK?我有最新版本的Android Studio,这是不可能的。我重新安装了SDK和Android Studio,但它仍然没有出现。仍然做同样的事情Layout_width changedSame。只显示那个红点。不过我没有收到任何错误。我的截图没有撒谎。我想知道我是否需要重新安装我的SDK?我有最新版本的Android Studio,这是不可能的。我重新安装了SDK和Android Studio,但它仍然没有在windows 10上显示。那有关系吗?这是我安装的Java版本吗?我安装在windows 10上。那有关系吗?这是我安装的Java版本吗?呜呜,它成功了!它疯了是因为我没有给它正确的风格吗?我从开发者的官方网站上看到了这段代码。。工作正常吗?那我就失败了。谢谢你的帮助。它正在工作。你会得到你的赏金的,所以让我相信它。呜呜,它成功了!它疯了是因为我没有给它正确的风格吗?我从开发者的官方网站上看到了这段代码。。工作正常吗?那我就失败了。谢谢你的帮助。它正在工作。你会得到你的赏金的,所以让我相信它。