I am using the following code to animate a scene. It will basically rotate the view by an angle of 225 degrees.
[viewToOpen.layer removeAllAnimations]; ViewToOpen.hidden = NO; ViewToOpen.userInteractionEnabled = NO; If (viewToOpen.layer.anchorPoint.x! = 0.0f) {viewToOpen.layer.anchorPoint = CGPointMake (0.0f, 0.5f); ViewToOpen.center = CGXXMake (OpenToOpen Center.x - VisualToOpen.boundsskies.width / 2.0F, ViewOpen.center.i); } CABasicAnimation * transformAnimation = [CABasic animation with animation: @ "Transform"]; Transformation animation. Deleted Completed = No; Change animation. Period = period; Transformation animation. TimingFunction = [CametiTimingFunction FunctionWidth Name: KCAMDiTimingFunctionExecuteAutAut]; CateringFor 3D andtransform = Cathetorform 3D McAfini Transforms (CGFine Transensk Macotation (225)); Transformation animation. Two Values = [NSVV valuesVeTextransformation 3D: And Transform]; CA Animation Group * The Group = [CA Animation Group Animation]; TheGroup.delegate = self; TheGroup.duration = Duration; [Group Set Value: [NSNumber Number With Intent: Visual OpenTag] Key: @ "View Too Openag"]; TheGroup.animations = [Objects with NSArray array: Transformation animation, zero]; TheGroup.removedOncompletion = No; [ViewToOpen.layer addAnimation: Group forKey: @ "flipViewOpen"];
But the problem is that, at the end of the animation, the scene is coming back to the original position. Even after the animation is complete I would like to keep this scene in that position. How can I do this?
I believe you are facing the same problem as can be seen And . You need to either set fillmode
to kCAFillModeForwards
or when the animation is complete, the layer's variation needs to be set.
Comments
Post a Comment