4

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

Valentin Rocher
  • 11,667
  • 45
  • 59
Stephmt69
  • 41
  • 1
  • 2

2 Answers2

11

does

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

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

marcc
  • 12,295
  • 7
  • 49
  • 59
0

You will get the size value, if "Use Autolayout" option in file inspector is unchecked