百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-native-circular-progress

> 前端框架
开源

使用 React Native 组件在 ReactART 中创建动画式圆形进度条

2.3K stars0 点赞3 次浏览
访问官网GitHub

工具介绍

使用 React Native 组件在 ReactART 中创建动画式圆形进度条

React-native-circular-progress

React Native 组件用于创建动画式圆形进度条。例如,可用于显示用户点。

示例应用

安装

  1. 安装此组件和 React-native-svg: npm i --save React-native-circular-progress React-native-svg
  2. 链接 SVG 的原生代码: React-native link React-native-svg

使用方法

javascript
import { AnimatedCircularProgress } from 'react-native-circular-progress';

<AnimatedCircularProgress
  size={120}
  width={15}
  fill={100}
  tintColor="#00e0ff"
  onAnimationComplete={() => console.log('onAnimationComplete')}
  backgroundColor="#3d5875" />

您还可以定义一个函数,该函数接收当前进度,例如在圆形中显示该进度:

javascript
<AnimatedCircularProgress
  size={200}
  width={3}
  fill={this.state.fill}
  tintColor="#00e0ff"
  backgroundColor="#3d5875">
  {
    (fill) => (
      <Text>
        { this.state.fill }
      </Text>
    )
  }
</AnimatedCircularProgress>

您还可以定义一个函数,该函数会接收进度圆圈顶部的位置,并渲染自定义的 SVG 元素:

javascript
<AnimatedCircularProgress
  size={120}
  width={15}
  fill={100}
  tintColor="#00e0ff"
  backgroundColor="#3d5875"
  padding={10}
  renderCap={({ center }) => <Circle cx={center.x} cy={center.y} r="10" fill="blue" />}
  />

最后,您可以通过在组件上添加一个引用并调用animate(toValue, duration, easing)函数来手动触发基于持续时间的定时动画:

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScriptanimationcirclefillprogress

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架