Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
229 views
in Technique[技术] by (71.8m points)

What's the meaning of android:progressBarStyle attribute in ProgressBar?

I've been looking through the documentation for ProgressBar class and found these attributes:

  • android:progressBarStyle
  • android:progressBarStyleHorizontal
  • android:progressBarStyleLarge
  • android:progressBarStyleSmall

These four parameters are supposed to be a reference to some style as I take it. So the question is, what are these for? Style for the progress bar is set via android:style attribute and a reference to the global style attributes.

Documentation doesn't say anything helpful, searched the Web, found nothing.

question from:https://stackoverflow.com/questions/4288807/whats-the-meaning-of-androidprogressbarstyle-attribute-in-progressbar

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The four attributes that you mention can be applied to a ProgressBar's style like so:

style="?android:attr/progressBarStyleHorizontal"

The style constant android:progressBarStyleHorizontal is your typical incremental progress bar:

alt text

While the other three are varying sizes of the same circular progress bar:

style="?android:attr/progressBarStyleSmall"

alt text

style="?android:attr/progressBarStyle"

alt text

style="?android:attr/progressBarStyleLarge"

alt text

Update:

According to adamp's comments:

These are attributes of the theme that point at themed styles you can use for progress indicators...They are not attributes for ProgressBar itself.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...