我想複製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