【问题标题】:Android ProgressBar does not moveAndroid ProgressBar 不动
【发布时间】:2021-06-19 00:40:02
【问题描述】:

我将 ProgressBar 添加到我的 activity_main 中

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <ProgressBar
        android:id="@+id/progress_circular"
        android:indeterminate="true"
        android:layout_width="50dp"
        android:layout_height="50dp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"/>

</androidx.constraintlayout.widget.ConstraintLayout>

它应该旋转,但它没有。我按照官方文档做的一切,我做错了什么?

【问题讨论】:

  • 我可以在左上角看到进度条。
  • 我也能看到,但不转。
  • 我只想看到下面答案中的旋转动画。将小部件添加到标记时,这应该是开箱即用的
  • 我在尝试你的代码时得到了这个旋转动画

标签: android progress-bar


【解决方案1】:

它正在工作!

问题不在 XML 代码中

【讨论】:

  • 您知道可能是什么问题吗?你有什么版本的安卓?
  • 原来我在开发者选项中关闭了“Animator 持续时间比例”。当我打开它时,我再次看到动画进度条。
【解决方案2】:

我也有这个问题。您应该在手机的开发者选项中启用所有动画。它会起作用的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-15
    • 1970-01-01
    • 2014-06-01
    • 2017-04-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多