I'm trying to expand a Container view. But I can't figure out why the elements it contains are not resizing too... They stay with the base sizes they had.
Here's what I tried (tell me if I do something bad or if it could be done easier)
[UIView animateWithDuration:1.5
delay:0.0 usingSpringWithDamping:1
initialSpringVelocity:0
options:UIViewAnimationCurveLinear | UIViewAnimationOptionCurveLinear
animations:^{
_heightConstraint.constant = [[UIScreen mainScreen] bounds].size.height;
_widthConstraint.constant = [[UIScreen mainScreen] bounds].size.width;
_posYConstraint.constant = -20;
_posXConstaint.constant = 0;
// I tried desperately the following mess :)
for (UIView* i in _container.subviews) {
[i layoutIfNeeded];
}
[_container layoutIfNeeded];
[self.view layoutIfNeeded];
} completion:nil];
Elements i.e sub views don't transform if you re size frame. you need to change the transform of the view and it will be applied to transform of all sub views.
<your view>.transform=CGAffineTransformMakeScale(2, 2);