0

My intention is to move a UIView Object.

The Code I use for this is:

[UIView animateWithDuration:(biggestViewWidth * 0.005) delay:1.0 options:UIViewAnimationOptionCurveLinear animations:^{


            //
            [view setFrame:CGRectMake(0, view.frame.origin.y, view.frame.size.width, view.frame.size.height)];

            // View verschieben
            [view setFrame:CGRectMake(-view.frame.size.width - 10, view.frame.origin.y, view.frame.size.width, view.frame.size.height)];

        } ...

But as is the example shown the view is linear moved to the new x position. Is it possible to say that the Animation should go with a step of 20 points for example more and more to the left? So for example: startX = 0; 1. = -20; 2. = -40; . . .

1 Answer 1

1

There are several ways to customize the animation curves. The easiest is to pass in one of these to your existing function: https://developer.apple.com/library/ios/documentation/uikit/reference/uiview_class/UIView/UIView.html#jumpTo_153

Otherwise, you can setup your own animation using keyframes as in this example: https://github.com/ShinobiControls/iOS7-day-by-day/blob/master/11-uiview-keyframe-animation/11-uiview-keyframe-animation.md

1
  • Can you post an concret example of my problem. Would be very helpful because I don't get it. Nov 21, 2013 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.