티스토리 뷰

공부/Android

DialogFragment 팁?

데자와 맛있다 2023. 7. 2. 00:48

-배경 drawable 리소스 지정

dialog?.window?.setBackgroundDrawableResource(R.drawable.rounded_all_corners)

 

-width, height 지정

val size = resources.displayMetrics.widthPixels
dialog?.window?.setLayout(size, ViewGroup.LayoutParams.WRAP_CONTENT)

 

view.window.속성지정()

이 방법은 여러 뷰들의 속성 지정할때 잘 사용될것같다

ViewGrop.LayoutParams. 해서 레이아웃의 파라메터 ? 직접 가져와 설정하는것도 자주 사용할수 있을것같다

 

https://wooooooak.github.io/android/2019/11/23/dialogFragment%EC%82%AC%EC%9D%B4%EC%A6%88%EB%B3%80%EA%B2%BD/

 

DialogFragment의 size(width, height)조절 · 쾌락코딩

DialogFragment의 size(width, height)조절 23 Nov 2019 | DialogFragment 마음처럼 되지 않는 DialogFragment 액티비티나 프레그먼트 위에서 DialogFragment를 띄우다 보면 DialgFragment의 전체 크기 조절이 마음처럼 되지 않

wooooooak.github.io

https://stackoverflow.com/questions/12478520/how-to-set-dialogfragments-width-and-height

 

How to set DialogFragment's width and height?

Let's say I specify the layout of my DialogFragment in an xml layout file named my_dialog_fragment.xml and I specify the layout_width and layout_height values of its root view to a fixed value (e.g.

stackoverflow.com

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함