AndroidカスタムDialog設定背景色
カスタムdialogのコード
白色半透明の設定:80 FFFFFFFF
WindowManagerの設定LayoutParamsサブアイテムレイアウト全画面:
Dialog dialog=new Dialog(carETCActivity.this);
dialog.setContentView(R.layout.dialog_layout);
WindowManager.LayoutParams layoutParams = dialog.getWindow().getAttributes();// dialog
// int width = dialog.getWindow().getWindowManager().getDefaultDisplay().getWidth();
// . color="#00000000"
dialog.getWindow().setBackgroundDrawableResource(dialog_bg);
layoutParams.width=800;//
layoutParams.height=500;//
// layoutParams.width=WindowManager.LayoutParams.MATCH_PARENT;//
// layoutParams.height=WindowManager.LayoutParams.MATCH_PARENT;//
dialog.getWindow().setAttributes(layoutParams);
dialog.show();
dialog.dismiss();//
白色半透明の設定:80 FFFFFFFF
100% FF
95% F2
90% E6
85% D9
80% CC
75% BF
70% B3
65% A6
60% 99
55% 8C
50% 80
45% 73
40% 66
35% 59
30% 4D
25% 40
20% 33
15% 26
10% 1A
5% 0D
:android:background="#XXxxxxxx"( color )
: , 8 , 2 , 6 。
WindowManagerの設定LayoutParamsサブアイテムレイアウト全画面:
layoutParams.width=WindowManager.LayoutParams.MATCH_PARENT;//
layoutParams.height=WindowManager.LayoutParams.MATCH_PARENT;//