Android horizontal progress bar demonstration, android horizontal progress bar
Progress bar: I believe everyone understands that with the progress bar, it will not cause the user to wait for a long time and feel that his program has crashed. Therefore, this demo can be viewed at the same time. Next, let's take a look at how it is implemented.
1 .:
2. layout description:
1. textview display progress bar
2. progress bar
3. Progress bar Configuration:
<ProgressBar
Android: id = "@ + id/pb"
Style = "@ android: style/Widget. ProgressBar. Horizontal"
Android: layout_width = "match_parent"
Android: layout_height = "wrap_content"
Android: max = "100" type = "codeph" text = "/codeph"/>
Max can be set manually, that is, the size of the downloaded content, and the style is also
3. instance source code:
4. The dowork () method is a simulated time-consuming operation. Of course, you can also use other methods, such as downloading images online, downloading images, and displaying them later.
The above are the fruits of my own work. Although small ones are the same as mosquitoes, they are also meat. I hope they can help you. Thank you.