Create a subclass and override onSizeChanged() or use a
ViewTreeObserver and its OnGlobalLayoutListener.

On Wed, Jun 17, 2009 at 2:09 PM,
JohnnyForeigner<[email protected]> wrote:
>
> Hey,
>
> I'm currently playing with this android stuff, doing some image
> manipulation using image view and matrices for a simple comic book
> viewer i'm writing.
>
> I want to be able to scale the image that I send to the image view to
> fit the size of the view as it is presented on the screen but when I
> call ImageView.getHeight() it returns 0.
>
> I know i have to wait for it to be laid out before I can get what this
> value should be but I don't know what the correct way to go about this
> is. I tried a basic loop that checked the height returned and kept
> checking until it returned something that wasn't 0 but this simply
> gave an infinite series of 0's returned.
>
> What's the best way of doing this?
>
> Thanks,
>
> Tom
>
> >
>



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