0

I need yo know how to measure a weighted view before it is drawn. I know there are some ways to measure view before it is drawn like call View.measure() on view or get its measure after View.post(), but they are not working with weighted view, probably because when view has weight the measuring process happens multiple times until the view can get its measure. Also please dont comment answers the related to get the view measures in onGlobalLayout or onPreDrawListener since in my case it causes the view to flicker (I am changing the view height/width so it cause flicekring).

  • look at this [link](https://stackoverflow.com/questions/9575706/android-get-height-of-a-view-before-it%C2%B4s-drawn) and also this [link](https://stackoverflow.com/questions/19908003/getting-height-of-text-view-before-rendering-to-layout/20087258) may help you – kAvEh May 20 '19 at 06:52
  • As i said most of these solution based on calling View.measure() to calculate view measures. Problem is that calling View.measure() on weighted view is not enough since measures stays 0 even after calling View.measure(). – OmerCohen1994 May 20 '19 at 08:00

0 Answers0