Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get size of IBOutlet UIImageView

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

like image 745
Stephmt69 Avatar asked Dec 23 '22 06:12

Stephmt69


1 Answers

does

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

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

like image 160
marcc Avatar answered Dec 27 '22 12:12

marcc