是否可以設置新的中心和動畫角度? 我試圖建立一個動畫來捲曲頁面,但只是部分,但默認情況下,這種效果卷頁從右下角到左上角。 以下是我用來爲此設置動畫的一段代碼。更改動畫的中心和角度
- (IBAction)curlUp{
// Curl the image up or down
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:0.35];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
if (!curled){
animation.type = @"pageCurl";
animation.fillMode = kCAFillModeForwards;
animation.endProgress = 0.78;
} else {
animation.type = @"pageUnCurl";
animation.fillMode = kCAFillModeBackwards;
animation.startProgress = 0.42;
}
[animation setRemovedOnCompletion:NO];
[[self view] exchangeSubviewAtIndex:4 withSubviewAtIndex:5];
[[[self view] layer] addAnimation:animation forKey:@"pageCurlAnimation"];
// Disable user interaction where necessary
if (curled) {
[[self view] exchangeSubviewAtIndex:4 withSubviewAtIndex:5];
[[[[self view] subviews] lastObject] removeFromSuperview];
} else {[self.view addSubview:ofertasCompraViewController.view];
[self.view bringSubviewToFront:self.view];
//[self.navigationController.navigationBar setUserInteractionEnabled:YES];
//[self.view setUserInteractionEnabled:YES];
}
curled = !curled;
}
結束進度集合,其中的頁面將停止冰壺,現在我想設置在哪個方向視圖將捲曲。
Thanx!