I am using a circular ProgressBar
in my Activty.My Problem is this it is not visible properly on my page because my page's BG color is same as ProgressBar .So how can I change the color of ProgressBar to make it properly Visible?
Please Help
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
You can also change the color of your progressbar programmatically in your activities oncreate or your fragments onViewCreated()
Here the color applied is "0xFFFF0000" which is red. You can change it according to your needs
Try using this in your XML
The easiest way is to use android:indeterminateTint attribute:
This is an old question, but using theme is not mentioned here. If your default theme is using
AppCompat
, yourProgressBar
's color will becolorAccent
you have defined.Changing
colorAccent
will also change yourProgressBar
's color, but these changes also reflects at multiple places. So, if you want a different color just for a specificProgressBar
you can do that by applying theme to thatProgressBar
alone:Extend your default theme and override
colorAccent
And in
ProgressBar
add theandroid:theme
attribute:So it will look something like this:
So you are just changing a
colorAccent
for your particularProgressBar
.Note: Using
style
will not work. You need to useandroid:theme
only. You can find more use of theme here: https://plus.google.com/u/0/+AndroidDevelopers/posts/JXHKyhsWHAHEdit
Here is the code for changing the color of ProgressBar by programatically.