ProgressBar 中 android:progressBarStyle 属性的含义是什么?
我一直在查看 ProgressBar
类的文档,发现了这些属性:
- android:progressBarStyle
- android:progressBarStyleHorizontal
- android:progressBarStyleLarge
- android:progressBarStyleSmall
这四个参数应该是对我所采用的某种样式的引用它。那么问题来了,这些是干什么用的呢?进度条的样式是通过 android:style 属性和对全局样式属性的引用设置的。
文档没有说任何有用的内容,搜索网络,一无所获。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您提到的四个属性可以应用于
ProgressBar
的样式,如下所示:样式常量
android:progressBarStyleHorizontal
是典型的增量进度条:而其他三个是相同圆形进度条的不同大小:
更新:
根据 adamp 的评论:
The four attributes that you mention can be applied to a
ProgressBar
's style like so:The style constant
android:progressBarStyleHorizontal
is your typical incremental progress bar:While the other three are varying sizes of the same circular progress bar:
Update:
According to adamp's comments:
如果有人正在寻找完整的代码块
In case if someone is looking for full block of code
令人困惑的部分是,通常,您可以为小部件(例如按钮)定义默认样式,如下所示:
然后,所有按钮将默认应用此样式。
人们可能会认为,如果这样做,progressBarStyle 属性也会对 ProgressBar 执行相同的操作:
但事实并非如此,因为
progressBarStyle
属于ActionBar
样式。The confusing part is that normally, you can define a default style for a widget (e.g. a button) like this:
All buttons will then by default have this style applied.
One would think that the progressBarStyle attribute would do the same for ProgressBar if doing this:
But that is not the case, since
progressBarStyle
belongs to theActionBar
styleable.