Get IBOutlet UIImageView Size

I need to get the IBOutlet UIImageView size created in Interface Builder.

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

Where (what method) and how (maybe another variable?) Can I get this information?

thanks for the help

+3
source share
2 answers

does

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

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

+10
source

You will get a size value if the "Use autorun" checkbox in the file inspector is not selected

0

Source: https://habr.com/ru/post/1730609/


All Articles