如何将 ProgressBar 的样式更改为小?
我很难找到正确的方法来指定进度条应该具有小的不定样式。
如果有人能为我和其他人提供一个快速搜索此信息的示例,我会很高兴。
I have some difficulties finding the correct way to specify that a progress bar should have the small indefinite style.
I would be glad if somebody could provide an example for me and others that do a quick search for this information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
解决方案是将样式更改为
The solution is to change the style to
另一种方法是
Ex_
One more way to do it is
Ex_
以下是如何以编程方式执行此操作:
Here is how to do it programmatically:
这可能有用:
This may be of use:
您可以通过scaleX和scaleY属性轻松更改进度条的大小,如下所示:
这里,
scaleX:更改宽度,因此0.5会将宽度减少到实际宽度的一半
scaleY:改变高度,因此0.5会将高度减少到实际高度的一半
You can change the size of progress bar easily by scaleX and scaleY property, like this:
Here,
scaleX: To change the width, so 0.5 will reduce the width to the half of the actual width
scaleY: To change the height, so 0.5 will reduce the height to the half of actual height
您可以通过在微调器中使用上述样式来实现彩色和小尺寸微调器
you can achieve color and small size spinner by using above style in spinner
根据@Rupesh Yadav的回答,您可以看到样式
@android:style/Widget.ProgressBar.Small
的结构:我可以确认设置最小和最大尺寸可以解决问题。显式设置宽度和高度不会更改 ProgressBar 的大小。所以你可以打造自己的风格。
According to the answer of @Rupesh Yadav, you can see a structure of the style
@android:style/Widget.ProgressBar.Small
:I can confirm that setting min and max sizes solves the problem. Setting width and height explicitly doesn't change the size of the ProgressBar. So you can make your own style.