Reputation: 1775
I create a CenterContainerView, which contains imageViews, after I add an imageView to CenterContainerView, the subviews of CenterContainerView are automatically aligned to center, I don't know how to implement it, I think may be I should use autoresizing mask to do it, right?
Upvotes: 1
Views: 3899
Reputation: 10201
To align subviews to the center of superView use the center property of a view.
imageView.center = CenterContainerView.center
;
Upvotes: 7