You need to use MeasureSpec.makeMeasureSpec(). You can't just pass EXACTLY,
you need to pass makeMeasureSpec(EXACTLY, 200) for instance.

On Thu, Jul 7, 2011 at 8:44 PM, Isliguezze <[email protected]> wrote:

> Hello folks!
>
> I have a pretty simple question with probably not that simple answer:
> how do I measure a newly created view before it's been rendered.
>
> For example
>
> TextView tv = getLayoutInflater().inflate(R.layout.textview, null);
>
> tv.getHeight() returns zero after measure() with EXACTLY, and AT_MOST,
> layout(), buildDrawingCache(), etc
>
> I need to get height of the view to show a PopupWindow at some
> location.
>
> Thank you.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Romain Guy
Android framework engineer
[email protected]

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to