gpt4 book ai didi

android - 如何在android中使用水平 "material progressindicator"?

转载 作者:行者123 更新时间:2023-12-03 13:50:20 24 4
gpt4 key购买 nike

我使用“android.material.progressindicator”来在水平 View 中显示进度,但我听不到我的 XML

<com.google.android.material.progressindicator.ProgressIndicator
android:background="@color/grey"
android:id="@+id/progressInd"
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Determinate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="false"
android:max="100"
android:progress="30"
android:progressDrawable="@drawable/bidding_progress" />

enter image description here

最佳答案

您可以使用:

<com.google.android.material.progressindicator.LinearProgressIndicator
app:indicatorColor="?attr/colorPrimary"
app:trackColor="@color/..."
/>
使用 progressIndicator.setProgressCompat((int) value, true);更新指标中的值。
使用属性:
  • indicatorColor设置指示器颜色的颜色
  • trackColor设置轨道颜色
  • trackThickness设置进度条的高度

  • enter image description here
    注:需要 至少版本 1.3.0-alpha04

    关于android - 如何在android中使用水平 "material progressindicator"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62218894/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com