Android/Kotlin
[Android][Kotlin] 뷰 길이, 너비 구하기 (get view height programmatically)
yoo.o
2021. 1. 21. 18:19
반응형
VIEW.viewTreeObserver.addOnGlobalLayoutListener {
// here your view is measured
// get height using my_view.height
// get width using my_view.width
}
테스트중
일단 constraint layout엔 됨
참고
stackoverflow.com/questions/21926644/get-height-and-width-of-a-layout-programmatically
Get height and width of a layout programmatically
I have designed an layout in which LinearLayout has 2 children LinearLayout and FrameLayout and in each child I put different views. I just wanted to measure height and width of FrameLayout so tha...
stackoverflow.com
반응형