1. 윈도우매니저
AlertDialog dialog = builder.show();
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
WindowManager.LayoutParams layoutParams = dialog.getWindow().getAttributes();
int width = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, AriesConstants.DIALOG_WIDTH, getResources().getDisplayMetrics());
int height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, AriesConstants.DIALOG_SELECT_HEIGHT, getResources().getDisplayMetrics());
layoutParams.width = width;
DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics();
layoutParams.height = (int) (displayMetrics.heightPixels * 0.84);
dialog.getWindow().setAttributes(layoutParams);
참고
반응형
'Platform > Android' 카테고리의 다른 글
[RecyclerView] 항목/아이템 사이에 줄 (0) | 2020.06.22 |
---|---|
[RecyclerView] onCreateViewHolder not called (0) | 2020.06.22 |
[RadioButton] CustomRadioButton (0) | 2020.06.12 |
[RadioButtion] 2개의 라디오 버튼 제어 (0) | 2020.06.12 |
[AAPT] (0) | 2020.06.08 |