Jan*_*usz 46 android android-progressbar android-styles
我在找到指定进度条应该具有小的不确定样式的正确方法时遇到了一些困难.
如果有人可以为我和其他人快速搜索这些信息,我会很高兴.
Jan*_*usz 125
解决方案是将样式更改为
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleSmall" />
Run Code Online (Sandbox Code Playgroud)
Rup*_*dav 14
另一种方法是
style="@android:style/Widget.ProgressBar.Small"
Run Code Online (Sandbox Code Playgroud)
Ex_
<ProgressBar
android:id="@+id/progress_bar"
style="@android:style/Widget.ProgressBar.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="7dip"
arandroid:visibility="visible" />
Run Code Online (Sandbox Code Playgroud)
Sil*_*ria 10
以下是以编程方式执行的操作:
ProgressBar progress = new ProgressBar(ctx, null, android.R.attr.progressBarStyleSmall);
Run Code Online (Sandbox Code Playgroud)
这可能是有用的:
style="?android:attr/android:progressBarStyleSmall"
Run Code Online (Sandbox Code Playgroud)
您可以通过scaleX和scaleY属性轻松更改进度条的大小,如下所示:
<ProgressBar
android:id="@+id/progressBar"
android:scaleX="0.5"
android:scaleY="0.5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
Run Code Online (Sandbox Code Playgroud)
这里,
scaleX:改变宽度,所以0.5会将宽度减少到实际宽度的一半
scaleY:改变高度,所以0.5会将高度减少到实际高度的一半
| 归档时间: |
|
| 查看次数: |
40618 次 |
| 最近记录: |