美好的一天,我怎樣才能改變我的背景AlertDialog中fragment?AlertDialog當(dāng)我單擊按鈕(片段-> 按鈕-> 警報(bào)對(duì)話框)時(shí),我的將顯示。我在實(shí)現(xiàn)我的AlertDialog和更改其背景顏色時(shí)嘗試了以下代碼:AlertDialog.Builder builder = new AlertDialog.Builder(getContext());builder.setTitle(R.string.scaleTitle);builder.setView(R.layout.scale_layout);builder.setNegativeButton("Close", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { dialogInterface.dismiss(); }});AlertDialog alertDialog = builder.create();builder.show();alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.YELLOW)); 但背景還是一樣。請(qǐng)問,我怎么可能改變它?謝謝你。
AlertDialog 更改片段中的背景顏色
ibeautiful
2021-06-28 13:59:49