是否可以设置新的中心和动画角度? 我试图建立一个动画来卷曲页面,但只是部分,但默认情况下,这种效果卷页从右下角到左上角。 以下是我用来为此设置动画的一段代码。更改动画的中心和角度
- (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!