I have this situation

enter image description here

the orange area is my view and green area is an ImageView; now I want ask you if there is a way to enlarge this imageView fullscreen and expand it over all view with an animation. I know how do an animation and I thought that I can use

imageView.transform=CGAffineTransformMakeScale(x, y);

but it's not simply, can you help me?

有帮助吗?

解决方案

This should be all you'll need to do. It will set the size of the imageView to match the size of the orangeView and position the imageView so it covers the orangeView.

[UIView animateWithDuration:0.5f animations:^{
    imageView.frame = orangeView.bounds;
}];
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top