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?
To align subviews to the center of superView use the center property of a view.
imageView.center = CenterContainerView.center
;