开发者

Using a UINavigationViewController on its own

开发者 https://www.devze.com 2022-12-17 08:21 出处:网络
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) wit

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

精彩评论

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

关注公众号