开发者

How to get navigation bar on ViewBased Application

H开发者_运维百科ow to add navigation bar on to ViewBased application [templet]


The following code will present a new navigation controller.

MyViewController *v = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
UINavigationController *t = [[UINavigationController alloc] initWithRootViewController:v];
[self presentModalViewController:t animated:true]; 
[t release];
[v release];

Otherwise, u can add the navigation bar to the nib file associated with the viewcontroller directly.


In your AppDelegate.m-file, add this under applicationDidFinishLaunching (or something like that).

UINavigationBar *navigationBar = [[UINavigationBar alloc] init];
[window addSubview:navigationBar];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜