In my custom View .xml , i have defined width and height as w = 600dp , h = 700dp
. Now i know getMeasuredHeight() / getMeasuredWidth() give values of width and height after view is drawn and they may differ from what i've given in .xml file , is there a workaround to get getMeasuredHeight()
and getMeasuredWidth()
values before view is actually drawn on layout, without use of onMeasure()
?
And How to calculate changed dp
sizes in different screens ? like my 600h*700w
when run on emulator converts to 300*300
.