ProgressBar 中 android:progressBarStyle 属性的含义是什么? [英] What's the meaning of android:progressBarStyle attribute in ProgressBar?
问题描述
我一直在查看 ProgressBar
类的文档,发现这些属性:
I've been looking through the documentation for ProgressBar
class and found these attributes:
- android:progressBarStyle
- android:progressBarStyleHorizontal
- android:progressBarStyleLarge
- android:progressBarStyleSmall
这四个参数在我看来应该是对某种风格的引用.那么问题来了,这些是干什么用的?进度条的样式是通过 android:style 属性和对全局样式属性的引用设置的.
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.
推荐答案
您提到的四个属性可以像这样应用于 ProgressBar
的样式:
The four attributes that you mention can be applied to a ProgressBar
's style like so:
style="?android:attr/progressBarStyleHorizontal"
样式常量 android:progressBarStyleHorizontal
是典型的增量进度条:
The style constant android:progressBarStyleHorizontal
is your typical incremental progress bar:
而其他三个是相同圆形进度条的不同大小:
While the other three are varying sizes of the same circular progress bar:
style="?android:attr/progressBarStyleSmall"
style="?android:attr/progressBarStyle"
style="?android:attr/progressBarStyleLarge"
更新:
根据亚当的评论:
这些是主题的属性指向您可以使用的主题样式进度指示器...它们不是 ProgressBar 本身的属性.
These are attributes of the theme that point at themed styles you can use for progress indicators...They are not attributes for ProgressBar itself.
这篇关于ProgressBar 中 android:progressBarStyle 属性的含义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!