开发者

UIImageView defined in IB has zero size?

A very short question. Created a UIImageView in IB with is a IBOutlet in its view controller. However, when it look开发者_高级运维 for its its size with .frame.size everything seems to be null. It would be nice to be able to set the dimensions in IB and have the code pick up and respond to it. Is there something I am doing wrong here?


I'm almost certain that you haven't connected your IBOutlet with appropriate view in IB.


Make sure you connect your UIImageView to it's IBOutlet in IB.

Also, the connections with the outlets aren't actually done until viewDidLoad, so you would still see nil if you tried to access the imageview before this method is called.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜