开发者

Using a UINavigationViewController on its own

In my开发者_如何学Python application which is based on a tabbar view controller with many uinavigationviewcontrollers for each tabbar items, I want to present at some point (at application launch) with a call to presentModalViewController that contains a uinavigationcontroller as a root so the user can do a few things... when he or she is finished, the Done button at the top right corner can be tapped to dismiss the modal view controller and then return to the base tabbar view.... How can I do that with Interface Builder ?


In XCode, create a new View XIB file and open it in Interface Builder. In this xib file, delete the View and drag a UINavigationController into it's place.

Then, in your view controller code, something like

UINavigationController *controller = [[UINavigationController alloc] initWithNibName:@"ModalViewController" bundle:nil];
[self presentModalViewController:controller animated:YES];
[controller release];

Will load your XIB and present it.

Hope this helps, any other questions don't hesitate to comment on this answer!

S

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜