Getting ImageView dimensions before adding the image

Posted by twk on Stack Overflow See other posts from Stack Overflow or by twk
Published on 2010-04-11T02:58:17Z Indexed on 2010/04/11 3:03 UTC
Read the original article Hit count: 428

Filed under:
|
|

I've got a RelativeLayout that contains these items:

LinearLayout
ImageView (weight = 1)
LinearLayout

So, the ImageView should expand and pin the other layouts on the top/bottom of the screen.

I'm loading the ImageView using an image stored on a web server. However, I can fetch images of any size from the server, so I'd rather just fetch the exact image size I need. Thus, I need to get the size of the ImageView before I actually fill it in. How can I do this?

© Stack Overflow or respective owner

Related posts about android

Related posts about imageview