Reputation: 8977
Is such thing possible? I have my UIScrollView created via IB and I wanted it as a subview of a UIImgeView I have, created in IB as well. If it is possible how do I do so?
Upvotes: 1
Views: 1794
Reputation: 38728
Short answer NO
. The workarounds depend on what's more important to you
UIImageView
subview hierarchy in the xib is most importantStart with a UIView
but change it's class to UIImageView
then set the image in code
self.myImageView.image = [UIImage imageNamed:@"someImage"];
Then do as you have been doing and add the subviews in code
[self.myImageView addSubview:someSubView];
Then place them in a container UIView
that is the same size as the UIImageView
Here you can see a container
UIView
that holds the UIImageView
and another subview
Upvotes: 2
Reputation: 1098
If you can't drag it into the UIImageView then I do not think it is possible,and an imageViews purpose is not meant to hold subviews. But it is just as easy to add it in code
[imageView addSubview:subView];
Upvotes: 0