核心代码:
dialog.getWindow().setDimAmount(0);//设置昏暗度为0
public void showDialog(){
AlertDialog dialog = new AlertDialog.Builder(getContext()).create();
dialog.getWindow().setDimAmount(0);//设置昏暗度为0
dialog.setCanceledOnTouchOutside(true);
dialog.show();
//设置自定义布局,必须要在show之后
dialog.getWindow().setContentView(R.layout.layout_menu_black);
}
效果图:
转载请注明原文地址: https://ju.6miu.com/read-1125056.html