Iphone - animate the new width and height

The following animates the view to the upper left of the screen (ipad):

[UIView beginAnimations:@"anim" context:nil];
[UIView setAnimationDuration:5];
[UIView setAnimationDelegate:self];
    someView.frame = CGRectMake(0, 0, 1024, 768);
[UIView commitAnimations];

However, it does not resize the view (think of the UIImageView that I want to explode). I suppose I should do this with the conversion somehow, but all I can solve is scale, rotate and translate (CGAffineTransformMakeRotation, CGAffineTransformMakeScale, CGAffineTransformMakeTranslation)

How to convert a view to a specific rectangle? I do not want just scaling. I need to stretch it to 1024x768, regardless of the intinental size.

+3
source share
2 answers

UIView CoreAnimation (CALayer), :

-beginAnimations etc :

someView.layer.bounds = CGRectMake(0, 0, 1024, 768);
0

contentMode? :

someView.contentMode = UIViewContentModeScaleToFill;

: , . Interface Builder : loadView viewDidLoad.

0

Source: https://habr.com/ru/post/1762111/


All Articles