问题描述
我有一个进度条,它以垂直方式设置样式,您可以在下面的drawable中看到
progress_verticle.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@android:id/background"
android:drawable="@color/transparent" />
<item android:id="@android:id/progress">
<scale
android:scaleWidth="0%"
android:scaleHeight="100%"
android:scaleGravity="bottom">
<shape>
<solid android:color="@color/logoDark" />
<corners
android:topLefTradius="1dp"
android:topRighTradius="1dp" />
</shape>
</scale>
</item>
</layer-list>
然后我以下面的方式在xml中使用它
<ProgressBar
android:id="@+id/idBrightnessControll"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="20dp"
android:layout_height="150dp"
android:layout_margin="30dp"
android:background="@color/bgblue"
android:max="15"
android:progress="1"
android:progressDrawable="@drawable/progress_verticle"
android:scaleWidth="0%"
android:scaleHeight="100%"
android:scaleGravity="bottom"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
现在,我还需要一个进度条,但是我不喜欢更改颜色"@color/logoDark"
。
因此,当前我要再创建一个progress_verticle_1.xml
,并将其颜色更改为具有不同颜色的不同进度条。
是否可以在xml本身中更改进度栏颜色,从而避免创建多个drawable
文件
编辑:-
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)