Open view with slide effect from bottom to top on iPhone

前端 未结 2 455
醉梦人生
醉梦人生 2021-02-01 11:19

I\'m making an application for iPhone (which runs in landscape mode) (OS 3.0), and I want that when I touch a toolbar button it opens a view with a slide effect (similar to the

相关标签:
2条回答
  • 2021-02-01 11:36

    If you are asking about doing the animation custom here's a snippet that might help. Lets assume the view "myView" is already added as a subview to the current view.

    [myView setFrame:CGRectMake(0, 480, 320, 480)];
    [myView setBounds:CGRectMake(0, 0, 320, 480)];
    
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1.0];
    [UIView setAnimationDelegate:self];
    [myView setFrame:CGRectMake(0, 0, 320, 480)];
    [UIView commitAnimations];
    

    The important numbers in there are the y positions in the setFrame rect (480 then 0), this moves it from offscreen to onscreen.

    0 讨论(0)
  • 2021-02-01 11:42
    [self.tabBarController presentModalViewController:yourSlideController animated:YES];
    
    0 讨论(0)
提交回复
热议问题