views:

72

answers:

2

Hello,

I need to get the size of an IBOutlet UIImageView drawn in Interface Builder.

But if I read the IBOutlet UIIMageView.image.size.width or .height in the viewDidLoad, viewWillAppear or viewDidAppear method I always get 0 !!!

Where (which method) and how (may be an other variable ?) can I get this information ?

Thank you for your help

+1  A: 

does

UIImageView *iv;  
width = iv.frame.size.width;

work any better? Instead of the image, get the size of the UIImageView.

marcc
This is exactly what I was looking for information !Thanks a lot !
Stephmt69
A: 

Are you looking for UIImage's size or UIImageView's size? Check this thread to get the UIImage's size

Hope this helps!

Mihir Mathuria
I needed UIImageView's size so marcc answered to my question perfectly but thanks for the interesting thread.
Stephmt69