如何改变ProgressDialog风格的Android?我需要更改背景颜色和文字颜色。的Android ProgressDialog风格
我有我的一个风格,我的应用程序,什么项目我必须重写改变进度对话框风格?
我想只用XML来改变风格,无需编码。这是可能的?
PS:
我有没有进步吧!我有进展对话。我想使用的风格和主题,以改变它的风格,就像我改变风格的列表视图,窗口背景等
如何改变ProgressDialog风格的Android?我需要更改背景颜色和文字颜色。的Android ProgressDialog风格
我有我的一个风格,我的应用程序,什么项目我必须重写改变进度对话框风格?
我想只用XML来改变风格,无需编码。这是可能的?
PS:
我有没有进步吧!我有进展对话。我想使用的风格和主题,以改变它的风格,就像我改变风格的列表视图,窗口背景等
定制dialogbar代码:下绘制 文件声明不同状态的颜色:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<gradient
android:startColor="#000001"
android:centerColor="#0b131e"
android:centerY="0.75"
android:endColor="#0d1522"
android:angle="270"
/>
</shape>
</item>
<item android:id="@android:id/secondaryProgress">
<clip>
<shape>
<gradient
android:startColor="#234"
android:centerColor="#234"
android:centerY="0.75"
android:endColor="#a24"
android:angle="270"
/>
</shape>
</clip>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<gradient
android:startColor="#144281"
android:centerColor="#0b1f3c"
android:centerY="0.75"
android:endColor="#06101d"
android:angle="270"
/>
</shape>
</clip>
</item>
</layer-list>
代码布局XML中:
<ProgressBar android:id="@+id/progressBar"
android:progressDrawable="@drawable/progress_bar_states"
android:layout_width="fill_parent" android:layout_height="8dip"
style="?android:attr/progressBarStyleHorizontal"
android:indeterminateOnly="false"
android:max="100">
</ProgressBar>
您可以更改ProgressDialog的主题是这样的:
ProgressDialog dialog = new ProgressDialog(this, AlertDialog.THEME_HOLO_DARK);
dialog.setTitle("Title");
dialog.setMessage("Message");
dialog.show();
我有没有进步吧!我有进展对话。我想使用的风格和主题,以改变它的风格,就像我的列表视图改变风格,窗口背景等 – Nik 2012-04-20 07:54:38