import android.app.ProgressDialog;
import android.content.Context;
import android.view.animation.Animation;
public class MyProgressDialog extends ProgressDialog {
public MyProgressDialog(Context context) {
super(context,R.style.NewDialog);
// TODO Auto-generated constructor stub
}
}
//资源样式文件 res->values->mydialog.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="NewDialog" parent="@android:style/Theme.Dialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowTitleStyle">@null</item>
<item name="android:colorBackground">#ffffff</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:width">30dip</item>
<item name="android:height">30dip</item>
<item name="android:textColor">#FF0000</item>
</style>
</resources>
//并在您的应用程序中的任何地方使用此代码以获取自定义进度对话框
MyProgressDialog pd = new MyProgressDialog(YouActivity.this);
pd.setMessage("Loading. Please wait...");
pd.show();
谢谢 :)