Android loading progress bar Usage Summary

Here, I would like to summarize the use of the loading progress bar.

1、 Speaking of the progress bar, we must talk about the bar progress bar, which is often used, especially the progress of downloading files, and like Tencent QQ installation progress bar, a progress always gives people a good user experience.

Let's look for the picture first. You can do it without pictures.

Take a look at the XML layout file. In fact, it is written directly in XML. Just add two attributes to set it, one style and the other background.

Let's look at style first

The progressdrawable here refers to a custom drawable, not a picture.

shape_ progressbar_ mini.xml

Let's look at shape_ progressbar_ bg.xml

In this way, a beautiful bar progress bar is done in shape_ progressbar_ In bg.xml, the border filling color is a good method. A progress bar border is added. In addition, in order to make the four corners of the progress bar round, this attribute < corners Android: radius = "90dp" / > is used.

It's done. You can be happy at this time. Go and have a glass of water first.

2、 Circular progress bar. Another commonly used is the circular progress bar, which indicates that it is in progress...

Look at two small pictures

First look at the first one, analyze the code, use a custom view and pop. LoadingDialog.java

Here, the view is quoted_ Loadingdialog.xml has been used as the background and loading box of the whole page.

view_ loadingdialog.xml

Look at this shape again_ loading_ Dialog.xml, it's good to draw the circular character of rotation without pictures.

In this way, the first circular progress bar is realized.

However, if you make a colored circular progress bar, or a colored one, it's better to add a picture later.

LoadingImgDialog.java

In fact, it is to modify a place, add residbg, and set the background of a small part of the circular progress bar with picture resources.

Slightly modify a sentence of code and change a picture to become another circular progress bar. Have fun.

Let's see the full screen effect picture. Just modify a sentence of code and change a picture.

Finally, show mainactivity. Java

Link to this article: http://www.cnblogs.com/liqw/p/3995794.html

Download address: http://download.csdn.net/detail/lqw770737185/8002967

Who wants the project, please leave your email. You haven't uploaded the source file yet. Leave a message if you have any questions. Good night, everyone.

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
分享
二维码
< <上一篇
下一篇>>