【发布时间】:2015-01-19 19:45:24
【问题描述】:
我开始将我的应用程序移植到棒棒糖中。我能够将整个应用程序主题化为我喜欢的特定颜色,但我无法更改始终为绿色的 ProgressDialog 的颜色。有没有办法做到这一点?
【问题讨论】:
-
您需要在警报对话框主题中设置 colorAccent。见stackoverflow.com/questions/26608390/…。
标签: android android-5.0-lollipop
我开始将我的应用程序移植到棒棒糖中。我能够将整个应用程序主题化为我喜欢的特定颜色,但我无法更改始终为绿色的 ProgressDialog 的颜色。有没有办法做到这一点?
【问题讨论】:
标签: android android-5.0-lollipop
您必须找到资源并使用 Photoshop 更改其颜色,或者创建新资源并将其用作进度对话框。
可以像这样创建新资产:
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:pivotX="50%" android:pivotY="50%" android:fromDegrees="0"
android:toDegrees="360">
<shape android:shape="ring" android:innerRadiusRatio="3"
android:thicknessRatio="8" android:useLevel="false">
<size android:width="76dip" android:height="76dip" />
<gradient android:type="sweep" android:useLevel="false"
android:startColor="#447a29"
android:endColor="#447a29"
android:angle="0"
/>
</shape>
并调用这个progress.xml,然后像这样使用它:
<ProgressBar
android:id="@+id/ProgressBar01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background ="@xml/progress">
你只需要改变开始和结束的颜色,让它变成你想要的样子
【讨论】: