Adnroid custom ProgressDialog loading (loading circle)

When I was working on the project two days ago, I found that sometimes when accessing network data, due to a lot of work to be done in the background, it took us a long time to return data, so the boss asked me to add a loaded logo diagram to improve the user experience

So I found many cases written by the great God on the Internet and completed a loading tool class in combination with my own situation

effect:

OK, now let's talk about how to do it

First customize a class to inherit ProgressDialog

Setting the loading layout file

Background color (self adjustable)

Loading circle style (self adjustable)

OK, you can use it

Why? I don't understand. Then I went to Baidu and Google and found it in a great God's article, but when I wrote this article, I found that I didn't save the great God's address and couldn't find it anymore

You need to pass in new loading when creating custom loading_ view(this,R.style.CustomDialog); style

OK, do it again

The above is the adnroid custom ProgressDialog loading (loading circle) introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>