It doesn't have a size yet in onCreate().   You should make a subclass of
the view and onSizeChanged() will be called when it gets its initial size or
that size changes.

On May 7, 2011 8:08 AM, "burtoogle" <[email protected]> wrote:
>
> Hi,
>
> I want to scale some (fixed length) text so that it nearly fills the
> view that contains it. The size of that view depends on the screen
> dimensions but, of course, is not exactly the width/height of the
> screen due to decorations, action bars, etc. The question is, how can
> you obtain the dimensions of an Activity's root view? Ideally, I would
> like to know this in the Activity's onCreate() method so that it can
> scale the text fields. When I try using getWidth()
> getMeasuredWidth(), I just get 0 returned.
>
> Thanks,
>
> Mark
>
>
>
>
> --
> 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

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