首页 > 解决方案 > Android Material LinearProgressIndicator 不重复

问题描述

调用showa后LinearProgressIndicator,指示器会前进到最后一次,然后隐藏。

从我发现的所有内容中,它应该不断重复,直到我隐藏它。

我宣布它喜欢

    <com.google.android.material.progressindicator.LinearProgressIndicator
        android:id="@+id/busyIndicator"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toTopOf="@id/map_view"
        android:visibility="invisible"
        android:indeterminate="true"
        app:indicatorColor="?attr/colorAccent"
        />

然后隐藏并显示它就像

if (busy) {
    binding.content.busyIndicator.show()
} else {
    binding.content.busyIndicator.hide()
}

我已经尝试删除对的调用,hide但它仍然被隐藏。我得到相同的行为CirclularProgressIndicator

我已经测试了 1.3.0 和 1.4.0-alpha02 版本

我已经更改了 XML 以使其开始可见,然后从不调用hideor show,然后它会正确重复。

有我缺少的功能吗?我不应该使用show吗?

标签: androidmaterial-components-android

解决方案


推荐阅读