views:

40

answers:

3

Hi,

in some iPhone/iPad Apps you can see screens sliding in and out.

How does the straight slide in/out work?

I could only find Curl and Flip for animation: UIViewAnimationTransitionFlipFromLeft, UIViewAnimationTransitionFlipFromRight, UIViewAnimationTransitionCurlUp, UIViewAnimationTransitionCurlDown,

A: 

If you make your app based on the navigation app template, the transitions for going from view to view will have that slide in/out animation.

Steve
A: 

not sure what you mean by sliding in and out, perhaps provide an example app with it

I think you mean pushing a view to the left to reveal the next view under it or something similar

-(void) slideView:(UIView *)uiv_slide toReveal:(UIView *)uiv_reveal withDuration:(double)d_duration {
    //Add the subview to the ViewController's view
    [self.view addSubview:uiv_reveal];

    //Bring the view to slide to the front
    [self.view bringSubviewToFront:uiv_slide];

    //Make an animation to slide the view off the screen
    [UIView animateWithDuration:d_duration
        animations:^ {
            uiv_slide.center = CGPointMake(-1*(uiv_slide.frame.size.width/2), uiv_slide.frame.size.height/2);  
        }
    ];
}

hopefully the code helps

ColdLogic
A: 

Take a look at some custom animations here. This will allow you to animate your views however you want. You can also use the apple navigation controller to build a drill down structure to your apps. Those view will automatically slide transition.

Geoff Baum