开发者

Flip Animation in a navigation controller's view

i am testing all day on this but i can not get it to work.

I have my main App Delegate class with my MainWindow.xib.

In this main class i create my navigation controller and MainWindow points to my MainViewController.xib. In this MainViewController i have a simple tableview, where i push some views on the navigation stack.

Till here it's working great. But i want the user to switch between two styles of presenting him data. One is the tableview, and the other option is something like a map. Doesn't matter. Just 2 different Views. So i thought of using a button on my nav bar to flip between these two views.

Don't get this subview flip to work.

I tried it with that source but didn't get it to work.

Some hints would be gre开发者_StackOverflowat!


Suppose you have all the navBar, buttons ready. You can use modal view for the solution:

-(void)changeView{
    //create some view
    [youNewView setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
    [self presentModalViewController:youNewView animated:YES];
}

You can use the above method to flip to a new view.

-(void) dismissView{
    [self dismissModalViewControllerAnimated:YES];
}

and use the second method in the new view to flip back.

I like this method a lot because you don't need to add any controller manually at all.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜