Animation to shrink view to top left corner
I would like to shrink my UIView to the top left corner. I am currently using a scale transform to achieve this,开发者_运维技巧 but the view is shrunk to the center. I have tried to change the layer's anchorpoint, but this results in the entire view changing position on screen . How should a transform be set up to achieve a shrink to the top left corner? Thank you
Something like:
[UIView beginAnimations:nil context:nil];
// setAnimationDuration
// set transform scaling
myView.center = CGPointMake (0, 0);
[UIView commitAnimations];
If you are transforming it to something like 50% of the screen you can change the center point to where it should be. For example, if it's a 320x480 view, you'll be scaling it to 160x240...so the center point will need to be 160/2 (80) and 240/2 (120)...
精彩评论