2010-10-25 115 views
0

在某些iPhone/iPad应用程序中,您可以看到屏幕滑入和滑出。如何让iPhone屏幕滑出? (动画)

直入式滑入/滑出如何工作?

我只能找到卷曲和翻转动画: UIViewAnimationTransitionFlipFromLeft, UIViewAnimationTransitionFlipFromRight, UIViewAnimationTransitionCurlUp, UIViewAnimationTransitionCurlDown,

回答

3

不知道你所说的滑动和退出的意思,也许提供了一个示例应用程序与它

我想你的意思是推视图左侧以显示其下或类似的东西下一视图

-(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); 
     } 
    ]; 
} 

希望的代码可以帮助

0

如果你把你的应用程序基于导航的应用程序模板,从视图去过渡查看将有幻灯片进/出动画。

0

看看一些自定义动画here.这将允许你,但是你想动画的看法。您还可以使用苹果导航控制器为应用程序构建向下钻取结构。那些视图会自动滑动转换。