Android ProgressDialog的自定义颜色和背景
我想为Android ProgressDialog的自定义颜色和背景,android,Android,我想为ProgressBar对话框自定义微调器、背景和文本颜色 我想通过style.xml跨4+和5个OS版本实现这一点 我的属性的正确父主题和属性是什么 我无法使用自定义绘图解决此问题,因为样式不是通过standard style.xml定义的 以下是微调器样式的示例,同样的样式也适用于进度条,如果您需要使用可绘制文件,可以将其用作背景,如下所示: <!-- Border for spinners--> <style name="spinner_style" pare
ProgressBar
对话框自定义微调器、背景和文本颜色
我想通过style.xml跨4+和5个OS版本实现这一点
我的属性的正确父主题和属性是什么
我无法使用自定义绘图解决此问题,因为样式不是通过standard style.xml定义的 以下是微调器样式的示例,同样的样式也适用于进度条,如果您需要使用可绘制文件,可以将其用作背景,如下所示:
<!-- Border for spinners-->
<style name="spinner_style" parent="AppBaseTheme">
<item name="android:background">@drawable/bg</item>
<item name="android:layout_marginLeft">10dp</item>
<item name="android:layout_marginRight">10dp</item>
<item name="android:layout_marginBottom">10dp</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingTop">5dp</item>
<item name="android:paddingBottom">5dp</item>
<item name="android:popupBackground">#CECCCD</item>
</style>
@可提取/背景
10dp
10dp
10dp
8dp
5dp
5dp
#CECCCD
bg.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item><layer-list>
<item><shape>
<gradient android:angle="90" android:endColor="#ebebeb" android:startColor="#ebebeb" android:type="linear" />
<stroke android:width="2dip" android:color="#32CD32" />
<corners android:radius="10dip"/>
<padding android:bottom="3dp" android:left="3dp" android:right="3dp" android:top="3dp" />
</shape></item>
<item ><bitmap android:gravity="bottom|right" android:src="@drawable/arrow" />
</item>
</layer-list></item>
</selector>
箭头:
希望这会有所帮助。您是想从java文件还是xml文件中执行此操作?可能与我提到的重复,我希望通过style.xml文件执行此操作。这不是重复的“如何在Android中自定义进度条”我的问题与样式设置有关,而不是实现新的drawableDon't use UPDATE(或EDIT),当更新帖子时。我们已经为此编辑了历史记录。确保文章是一个可读的连贯的整体。