Question

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?

Was it helpful?

Solution

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;
}];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top