Open view with slide effect from bottom to top on iPhone
Asked Answered
M

2

6

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 effect when you touch 'Bookmarks' in Mobile Safari's toolbar) from the bottom to the top of the screen. The view is in the same XIB file as the button.

How can I do this?

Thanks in advance.

Mccann answered 21/8, 2009 at 14:40 Comment(0)
F
7
[self.tabBarController presentModalViewController:yourSlideController animated:YES];
Faddish answered 21/8, 2009 at 14:48 Comment(0)
V
10

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.

Vetiver answered 21/8, 2009 at 16:27 Comment(1)
It is working best for more applying SlideView as in iphone facebook app more option.Nevis
F
7
[self.tabBarController presentModalViewController:yourSlideController animated:YES];
Faddish answered 21/8, 2009 at 14:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.