相关疑难解决方法(0)

android - 启动画面上的进度条

我的应用程序在加载时显示启动画面。我想在初始屏幕上的图标下方放置一个动画进度条。我尝试使用 XML,但它崩溃了!说无效的标签进度条。

这是我在styles.xml 中调用闪屏的代码

<style name="AppTheme.BrandedLaunch" parent="AppThemeDark">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="android:windowBackground">@drawable/background_splash</item>
</style>
Run Code Online (Sandbox Code Playgroud)

这是我的 background_splash.xml 文件

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
    android:drawable="@color/splash_screen_bg"/>

<item>
    <bitmap
        android:gravity="center"
        android:tileMode="disabled"
        android:src="@drawable/ic_launcher"/>
</item>

<item>
<ProgressBar
    android:id="@+id/progressBar"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
/>
</item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)

我真的不想使用不同的方法制作启动画面,因为这种方法非常简单。有任何想法吗?

java xml android splash-screen progress-bar

7
推荐指数
1
解决办法
9227
查看次数

标签 统计

android ×1

java ×1

progress-bar ×1

splash-screen ×1

xml ×1