Java Android Studio:进度栏看起来很老(如Android 5)

发布于 2025-02-06 06:13:13 字数 980 浏览 2 评论 0原文

我最近遇到了一个奇怪的问题。当我尝试将进度条添加到项目中时,它们的外观看起来像Android应用的石头时代:

< img src =“ https://i.sstatic.net/jfoot.png” alt =“在此处输入图像说明”>

在Android 12的最终构建中,它们也看起来像是这样。它们也很懒惰。我想使用默认材料设计进度栏。除此之外,它似乎适用于我拥有的其他项目。

这是我用于progressbars的代码(只有代码,Android Studio通过Designer View使用):

<ProgressBar
        android:id="@+id/progressBar3"
        android:layout_width="match_parent"
        android:indeterminate="true"
        android:layout_height="wrap_content" />

    <ProgressBar
        android:id="@+id/progressBar5"
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

这是build.gradle:Gradle:Gradle:Gradle:

 defaultConfig {
    
    minSdkVersion 21
    targetSdkVersion 30
    versionCode 1
    versionName "0.1"
}

I recently encountered a strange problem. When I try to add progress bars to my project, their appearance looks like the stone-age of android apps:

enter image description here

They also look like this in the final build for Android 12. They are also really laggy. I'd like to use the default Material Design Progressbars. It seems to work for every other project I have, except for this.

This is the code I use for the Progressbars (just the code, Android Studio uses via the designer view):

<ProgressBar
        android:id="@+id/progressBar3"
        android:layout_width="match_parent"
        android:indeterminate="true"
        android:layout_height="wrap_content" />

    <ProgressBar
        android:id="@+id/progressBar5"
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

And this is the default-config of the build.gradle:

 defaultConfig {
    
    minSdkVersion 21
    targetSdkVersion 30
    versionCode 1
    versionName "0.1"
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

荒人说梦 2025-02-13 06:13:13

尝试改变样式

 <ProgressBar
  android:id="@+id/Bar"
  style="@android:style/Widget.ProgressBar.Horizontal"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:progress="25"/>

Try to change style

 <ProgressBar
  android:id="@+id/Bar"
  style="@android:style/Widget.ProgressBar.Horizontal"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:progress="25"/>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文