super.onCreate(savedInstanceState);

// 뒷배경 흐리게 하기

WindowManager.LayoutParams layoutParams= new WindowManager.LayoutParams();

layoutParams.flags= WindowManager.LayoutParams.FLAG_DIM_BEHIND;

layoutParams.dimAmount= 0.7f;getWindow().setAttributes(layoutParams);

setContentView(R.layout.layout_name);

// 사이즈 조절

DisplayMetrics dm = getApplicationContext().getResources().getDisplayMetrics();

int width = (int) (dm.widthPixels * 0.9); // Display 사이즈의 90%

int height = (int) (dm.heightPixels * 0.9); // Display 사이즈의 90%

getWindow().getAttributes().width = width;

getWindow().getAttributes().height = height;

+ Recent posts