我想复制iOS 7主屏幕动画。主要是我很感兴趣的滚动视图到特定点缩放(左上如果图标是存在的,中间或右上角等)复制iOS 7主屏幕动画
http://www.youtube.com/watch?v=qBL8eQmQaVU
我以为我可以使用CGAffineTransformMakeScale但我不能”找出一种方法将其扩展到特定点。有任何想法吗?
我想复制iOS 7主屏幕动画。主要是我很感兴趣的滚动视图到特定点缩放(左上如果图标是存在的,中间或右上角等)复制iOS 7主屏幕动画
http://www.youtube.com/watch?v=qBL8eQmQaVU
我以为我可以使用CGAffineTransformMakeScale但我不能”找出一种方法将其扩展到特定点。有任何想法吗?
你可以使用动画块吗?在动画,你可以通过
UIGraphicsBeginImageContext(scrollView.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[scrollView.layer renderInContext:context];
UIImage *screenShot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
渲染滚动视图的内容一个UIImage你会把此图像中滚动视图的图像预览(图像视图的内容模式设置为调整大小以适应)覆盖现有的内容并使图像视图始终与滚动视图大小相同。使其看起来像整个滚动视图正在调整大小。
这里是动画块代码。
缩小
scrollView.frame = icon.frame
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationDelay:1.0];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
scrollview.frame = window.frame;
[UIView commitAnimations];
放大
scrollView.frame = window.frame
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationDelay:1.0];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
scrollview.frame = icon.frame;
[UIView commitAnimations];
这对我不起作用 – Alfa