Android: Best way to create a custom shaped Progressbar

邮差的信 提交于 2019-12-24 00:15:44

问题


I would like to create a custom shaped progressbar, which would change color according to its progress (but this is almost a different question..).

So what would be the best way to create a custom shaped progressbar like the one on the image below (sorry for bad MS Paint drawing skills):


回答1:


To have all possibilities you should create a custom class derived from progressbar and completely override the onDraw() Method. to draw the Arch on the side you can use canvas.drawArc() and to change the color of the bar you can simply adjust the Paint Color.



来源:https://stackoverflow.com/questions/19357211/android-best-way-to-create-a-custom-shaped-progressbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!