Android AlertDialog 自定义样式-出现-清除黑边白边主题底色 V7库

1、style添加样式

backgroundDimEnabled 属性背景是否变暗

android:backgroundDimEnabled

2、使用

AlertDialog.Builder builder = new AlertDialog.Builder(this,R.style.loading_dialog_style);

final AlertDialog alertDialog = builder.create();

alertDialog.setCanceledOnTouchOutside(false);

alertDialog.show();


// inflate就没有了最外层的布局了。
View view = View.inflate(this, R.layout.dialog_exit_app, null);
// setContentView 必须在show后

alertDialog.getWindow().setContentView(view);


你可能感兴趣的:(安卓)