In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "how to customize the color of the progress bar in Android". In the daily operation, I believe that many people have doubts about how to customize the color of the progress bar in Android. The editor consulted all kinds of materials and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the doubt of "how to customize the color of progress bar in Android". Next, please follow the editor to study!
Styles.xml
When you find xml, go in and find:
True @ android:drawable/progress_medium_white repeat 3500 48dip 48dip 48dip 48dip
This is the default circle, but today we will not modify this, we are going to change the color of the horizontal progress bar, so find:
False @ android:drawable/progress_horizontal @ android:drawable/progress_indeterminate_horizontal 20dip 20dip
You see, the system is related step by step, with very high expansibility and low coupling, so now we just need to change how the progress bar is drawn, but the one responsible for drawing the progress bar is so that we can find the progress_horizontal file under drawable, change it and change the color of the progress bar.
See, this is the layout condition drawn by the progress bar of the system.
Android:startColor= "# 80ffd300" android:centerColor= "# 80ffb600" android:endColor= "# ff747674"
We only need to change this color value to change his color, the main change is the lower color value.
After all that has been said, how to do it is very simple:
Create a new style.xml file under our project
Create a style tag, integrate the system default style, and then customize a new progressDrawable file, which can be referenced later in progress in layout.
50dip 8dip false @ android:drawable/progress_indeterminate_horizontal @ drawable/progressbar_mini
Here is my progressbar_mini file, which changes the color value of android:endColor= "# F5F5F5" android:startColor= "# BEBEBE"
Finally, just quote it.
At this point, the study on "how to customize the color of the progress bar in Android" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.