我正在尝试为进度条设置动画,以便需要 1 分钟才能线性填充。
这是我的代码:
animator = ObjectAnimator.ofInt(progress_bar, "progress", 0, 100);
animator.setDuration(1000 * 60);
animator.setInterpolator(new LinearInterpolator());
animator.start();
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="9sp"
android:layout_centerHorizontal="true"
android:max="100"
android:min="0"
android:progress="0"
android:progressDrawable="@drawable/custom_progress_bar"
android:visibility="visible" />
进度条填满太快,大约20秒,而不是1分钟
最佳答案
在“开发者选项”下,有“动画器持续时间比例”选项。这可能是导致您出现问题的原因。
希望有帮助。
关于android - 使用 ObjectAnimator 时进度条进度太快,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57008258/