android - 如何制作像 Telegram 一样的循环进度条?

标签 android telegram

我想要一个确定的圆形进度条,例如 Telegram android 应用程序,但我在项目源中找不到它。

enter image description here

它正在旋转

enter image description here

更新:我正在使用 material progress但它不会在确定模式下旋转,我想要的是在加载时旋转......就像 Telegram 应用程序一样。

最佳答案

在 res/anim 文件夹中创建一个 rotate.xml:

<?xml version="1.0" encoding="UTF-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1600"
    android:fromDegrees="0"
    android:interpolator="@android:anim/linear_interpolator"
    android:pivotX="50%"
    android:pivotY="50%"
    android:repeatCount="infinite"
    android:toDegrees="360" />
加载动画并在代码中运行:
view.startAnimation(AnimationUtils.loadAnimation(activity, R.anim.rotate));

关于android - 如何制作像 Telegram 一样的循环进度条?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31177167/

相关文章:

android - mGoogleApiClient 无法在另一个 Activity 中实现

java - 无法将 notificationDataSetChanged() 与 RecyclerView 一起使用,导致 NullPointerException

android - 为什么 Android Softkeyboard 隐藏了最底部的 TextView?

android - Spinner - 关注第一个项目

java - 无法比较类型错误 : Object and int in Telegram

java - 如何在从 cordova 创建的 native 代码中使用相同的 android SQLite DB?

python - 使用 Telegram-InlineKeyboardMarkup,我可以在按下按钮时向用户提供反馈吗?

mongodb - 具有多个支付提供商的商店计费模式设计

c# - 我如何在 Telegram Bot 中不使用 "CallbackData"的情况下回答 "AnswerCallbackQueryAsync"(C#)

android - 如何在主题更改时制作循环显示效果? (就像在 Telegram 或 VK 中一样)