我想改变我现在拥有的几乎不可见的东西: 为此:
这是一个没有文字、标题和背景的自定义进度对话框。只有旋转器。
我将此实现用于进度对话框:
public class IndeterminateProgressSpinner extends Dialog {
static Dialog dialog;
public static IndeterminateProgressSpinner show(Context context,
OnCancelListener cancelListener) {
dialog = new IndeterminateProgressSpinner(context);
dialog.setTitle(null);
dialog.setCancelable(false);
dialog.setOnCancelListener(cancelListener);
/* The next line will add the ProgressBar to the dialog. */
ProgressBar pb = new ProgressBar(context);
dialog.addContentView(pb, new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
dialog.show();
return (IndeterminateProgressSpinner) dialog;
}
public IndeterminateProgressSpinner(Context context) {
super(context, R.style.indeterminateProgressSpinner);
}
这就是风格R.style.indeterminateProgressSpinner
<style name="indeterminateProgressSpinner">
<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:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:background">@android:color/transparent</item>
<item name="android:indeterminateOnly">true</item>
</style>
谢谢你