I have a UIView inside a UIViewm and I want the inner UIView to be always centered inside the outer one, without it having to resize t
UIView
I would use:
child.center = CGPointMake(parent.bounds.height / 2, parent.bounds.width / 2)
This is simple, short, and sweet. If you use @Hejazi's answer above and parent.center is set to anything other than (0,0) your subview will not be centered!
parent.center
(0,0)