上代码
1 AfOpenFlowView.m
修改 -(void)setUpInitialState... { 修改 leftTransform = CATransform3DIdentity; leftTransform = CATransform3DRotate(leftTransform, SIDE_COVER_ANGLE, 0.0f, 1.0f, 0.0f); rightTransform = CATransform3DIdentity; rightTransform = CATransform3DRotate(rightTransform, SIDE_COVER_ANGLE, 0.0f, -1.0f, 0.0f);
为 leftTransform =CATransform3DTranslate(CATransform3DIdentity,0,0, SIDE_COVER_ZPOSITION /2.0); leftTransform =CATransform3DRotate(leftTransform, SIDE_COVER_ANGLE,0.0f,1.0f,0.0f); rightTransform =CATransform3DTranslate(CATransform3DIdentity,0,0, SIDE_COVER_ZPOSITION /2.0); rightTransform =CATransform3DRotate(rightTransform, SIDE_COVER_ANGLE,0.0f,-1.0f,0.0f); } -layoutCover:selectedCover:animated.. { 添加 CGFloat newZPosition = SIDE_COVER_ZPOSITION /2.0; 添加 CABasicAnimation*zPositionAnimation =[CABasicAnimation animationWithKeyPath:@"zPosition"]; [zPositionAnimation setToValue:[NSNumber numberWithFloat:newZPosition]]; [zPositionAnimation setDuration:(animated ?.3:0.0)]; [zPositionAnimation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; [zPositionAnimation setRemovedOnCompletion:NO]; [zPositionAnimation setFillMode:kCAFillModeForwards]; 修改 aCover.layer.zPosition = newZPosition; 为 [aCover.layer addAnimation:zPositionAnimation forKey:nil]; } 使用 ios4 ios5 |