You're doing it wrong :) More seriously, you are measuring the View to be
exactly 0px large in both dimensions. The values passed to measure() must be
generated using MeasureSpec.make(). Of course, using EXACTLY you will be
measuring the View with the exact dimensions you specify, which means
getMeasured*() will probably return these values. What you want is probably
AT_MOST instead.

On Tue, Nov 9, 2010 at 5:13 AM, siliconeagle <[email protected]> wrote:

> I have a custom view i am writing for my drawing app - but the first
> time i set the drawing into it i need to get the dimension for the
> view (using getMeasuredWidth() & getMeasuredHeight()). But until the
> view display these return 0. I have tried calling:
> requestLayout()
> invalidate()
> numDraw.measure(MeasureSpec.EXACTLY, MeasureSpec.EXACTLY);
>
> but nothing seems to force the values to update.
>
> I guess the question i am asking is : does anyone have any tips on how
> to get view to update its measurements off screen?
>
> best
> rob m
>
> --
> 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]<android-developers%[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]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them

-- 
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