objective c - Mimicking "normal" view transtion when changing UITabBar's selected tab -


For very boring reasons to describe, I go to a different view programmatically to my Application Tab tab Changing. Unfortunately it's immediately and we want the normal snapshot load effect when you do pushViewController on a navigation controller.

I am very inexperienced with the use of animation in OGJC C, I tried to use some code which I found here:

  CGContextRef reference = UIGraphicsGetCurrentContext ( ); [UIView Start Permissions: Zero References: Reference]; [UIView Set Animation Transition: UIViewAnimationTransitionFlipFromLeft forView: [Self View] Cache: Yes]; [UIView Set Animation Cave: UIViewAnimationCurveEaseInOut]; [UIView Set Animation Duration: 2.0]; [[[NAV] tabbar controller] Index selected from set: 2]; [UIView commitAnimations];  

It does one type of animation, the nav bar appears mysteriously from the top, which I wanted, is not it :)

< P>

The easiest way to do what you want your animation is to place it before the place you want it to come from That's outside the screen, possibly) and then to start the [UIView ...] block, in which you set a new frame So the general setting is:

  CGRTE Newframe = theView.frame; Newframe.origin.x = 320.0f; TheView.frame = newframe; [UIView startup permissions: zero reference: zero]; // btw reference animation representative is just your reference for callback! Newframe.origin.x = 0.0f; TheView.frame = newframe; [UIView commitAnimations];  

Note that all this code is executed in one moment, so setSelectedIndex will be set immediately: because UIView There is no animated, it is not animated to fire some before the animation, take a look at other questions. (To summarize: use animation delegate, or select displayer: later :)


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -