lodingDialog = new Dialog(this,R.style.dialog_noBorder); lodingDialog.setContentView(R.layout.file_explore_dialog_loading); //让ContentView的fill_parent属性生效 lodingDialog.getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);