2010-10-25 111 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.這將允許你,但是你想動畫的看法。您還可以使用蘋果導航控制器爲應用程序構建向下鑽取結構。那些視圖會自動滑動轉換。