android - 进度条和系统动画设置关闭
问题描述
我是Android编程的初学者。我试图在我的应用程序上显示一个圆形进度条,但在 Android 7.0 手机上没有显示进度,或者在其他 Android 8.0 手机上显示一个圆形箭头不旋转。在互联网上进行了长时间的研究后,我发现这是因为在开发人员设置中禁用了动画。我不喜欢窗口动画,过渡......这个问题有什么解决方案吗?我的应用程序中的一些设置可以为进度条启用动画吗?
根据要求,我添加了一些代码。但是我的代码没有什么特别之处。我使用 Android Studio 生成了一个空应用程序。最低 SDK 21,目标 SDK 28。
我的应用程序布局:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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">
<ProgressBar
android:id="@+id/Progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"/>
<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" />
我的应用程序主要活动:
package ro.essd.testprogbar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
从开发人员选项中,只有 Animator Duration Scale 会做一些事情。如果禁用,结果如下:
如果上述设置设置为 1x,则进度条正在旋转。
谢谢!
解决方案
推荐阅读
- openssl - 如何在 CentOS 7 上修复 Certbot 的不完整链?
- php - 如何检查 cmb2 选择字段是否只允许选择唯一值
- reactjs - scalajs-react:如何循环对象的 Seq 以填充 UI
- ios - 单元测试未在 IOS swift 5 上运行
- php - MPDF复选框未显示刻度线
- ckeditor - MentionPlugin - 使用向下转换扩展自动完成查询
- python - typedef 的 Python 等效项
- salesforce - 为什么 SalesForce on before delete 触发器在处理之前删除记录?
- twig - 具有重复循环的不均匀画廊
- typescript - 解决错误:作为解析器 ESLint 加载的带有无效接口的打字稿