What would be the best way to make an icon seem to "jump" from a toolbar into a UITabBarItem.
I have found the CAKeyframeAnimation class which looks promising but I just can't get it to work. I have been using code similar to this : http://www.bdunagan.com/2009/04/26/core-animation-on-the-iphone/ but no matter what I set my endPoint to, the icon always ends up in the top of the screen.
I'm trying to achieve something similar to the effect used when you move a message in the Mail application. Is CAKeyframeAnimation suitable or is there an easier way to do this?
Thanks in advance.
When you say "the icon always ends up in the top of the screen", do you mean that the animation runs, but the icon hops back to the top of the screen at its completion? If so, make sure that you've set the animation's fillMode to kCAFillModeForwards and its removedOnCompletion property to NO.
For another example of a CAKeyframeAnimation that animates an object along a curve, see my answer to this question.
Related
In the Path iphone application, on the bottom left corner, there is a + sign button. When pressing it, it performs an animation (the + rotates and a bunch of other buttons emerge outwards).
For those that have seen these types of animations, how is this accomplished? Is this done via CAAnimations?
Thank you!
You would definitely want to use either Core Animation, or UIView's animation methods (which use Core Animation under the hood).
Check out https://github.com/levey/QuadCurveMenu to see one attempt to reimplement it.
I am writing an iPhone app but have run into a problem with an animation effect I am trying to implementing.
I am trying to add a half page curl effect from TOP.
I am using CAAnimation of "pageCurl", with the subtype set to kCATransitionFromTop or Right. And I also tried to use UIModalTransitionStylePartialCurl of the UIViewController.
But it curls the page from the botton.
My main problem is how to change the transition direction, to get it to curl from the top.
Can anyone help me? I feel that stackoverflow can fix my problem.
Waiting for your replying....
Regards.
Huh. Just an idea, but what if you tried rotating the view 180 degrees so that its upside-down using a CGAffineTransform (view.transform = CGAffineTransformMakeRotation(M_PI)) or something? Maybe if the view is upside-down, the animation will also be that way. Its kind of convoluted, and you might need to do a bunch of rotations and reorganizations with subviews to make them positioned correctly and right-side-up oriented, but might work.
I'm animating an image in an UIImageView. This works just great with Core Animation. Now I want to attach one end of a line permanentely to the center of this UIIMageView. But with Core Animation I only get the starting point and the end point of the UIImageView. Is there a possibility to access interim points during the animation? I want to extend the functionality to many UIImageViews, which are animated, with a line attached to them. I don't want to create timers to monitor all animations and calculate my own interim points. Does somebody have any suggestions? Thanks!
Bye, Björn
If you're using Core Animation (I'm not sure if this works with strictly UIView-based animation), you should be able to get a particular instantaneous value of your property by looking at the presentationLayer property of your view's backing CALayer. That property exposes a read-only copy of the current set of values as a layer is animating. You can look at this on a display link "timer" and update something else, etc.
I'm having a tough time picturing exactly what you're trying to accomplish overall, but this might get you started.
I found this post, which points to the right direction: http://dbachrach.com/blog/2008/04/instantaneous-frame-of-moving-core-animation-views/
But there's still one problem: this seems to work for CABasicAnimations only, not for the standard animations. Is there a way to access interim points when using standard animations ([UIView beginAnimation] ...)?? Thanks.
Björn
I hardly know how to explain my case other than to point to the excellent Absolute vodka app, Drink Spiration.
I am trying to make a carousel like image browsing with a little spice. I would really like to find a simple core animation explanation on how to accomplish something like the above app.
I hope someone can help with this. The solution doesn't have to be exactly the same, but just explain what is happening and it would be best if it was simple and no opengl. Just something to point me in the right direction. I don't think using just a scrollview with uiimageviews is enough.
I wrote something similar and its quite easy once you figure it out in your mind. All done justing using regular old views and animating transforms on them.
Say its 3 images on screen, and you can rotate new ones on and off ... then you will need 5 views set up (most simply just a UIImageView with a relevant image set). They are the currently selected image, the two either side of it and the ones that are, or will be animating on or off when the user flicks left or right.
Each of these 5 images has a position, an angle and an image. When the user flicks left or right each gets animated to the next position and angle, views that are about to come onscreen have their image updated to the next image in the set. If the user keeps on flicking in the same direction you simply reposition views on one side as they come off the other.
With this setup you can do lots of cool carousel like things very simply.
I want a UIView with a glowing or pulsing effect, like the status bar during a call on the iPhone. Does anyone know how I would go about doing this? I've experimented with NSTimer but can't seem to find how to go about this.
Thanks!
The animation API has the ability to message a callback you provide when the animation completes. You can use the API to daisy-chain together a series of animations from one state to another, giving the pulse effect you are looking for.