进度指示器
有什么办法可以让进度条变成圆形吗?我的应用程序中有一个播放按钮,并且想在按钮周围显示加载歌曲的进度。
Is there any way to make the progress bar into a circle shape? I have a play button in my apps and would like to show the progress of loading the song around the button.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ProgressBar 小部件有两种影响其外观的模式:
我最近构建了一个倒计时进度指示器,我希望一个盒子能够像时钟一样随着时间的流逝而倒退。这听起来很像你想做的事情,只是相反。
我所做的是创建我自己的 View 子类。然后在 onDraw() 重写中,我直接在画布上绘画。这听起来可能很麻烦,但它确实很简单,而且实际上可以控制整个绘画过程。
像这样绘制整个盒子......
有很多绘制方法可以用来绘制其他形状,线条,路径,圆形等。
The ProgressBar widget has two modes which affect how it looks:
I recently built a countdown progress indicator where I wanted a box to "unwind" like a clock going backwards as time ticked down. This sounds very much like what you want to do, only in reverse.
What I did was create my own class that subclasses View. Then in my onDraw() override I painted directly on the canvas. It might sound like too much trouble, but it's really easy and actually kinda controlling the whole painting process.
Something like this to draw the box all the way around...
...there are plenty of draw methods you can use to draw other shapes, lines, paths, circles, etc.