【发布时间】:2012-12-11 07:10:18
【问题描述】:
CurrentViewController.h
#import <UIKit/UIKit.h>
#import "nextNavViewController.h"
@interface CurrentViewController : UIViewController
{
nextNavViewController *contr;
}
- (IBAction)showNavView:(id)sender;
@end
CurrentViewController.m
/*..........*/
- (IBAction)showNavView:(id)sender {
contr = [[nextNavViewController alloc]initWithNibName:@"nextNavViewController"bundle:nil];
[self presentViewController: contr animated:YES completion:nil];
}
/* ......... */
nextNavViewController.h
#import <UIKit/UIKit.h>
@interface nextNavViewController : UINavigationController
@end
我有“nextNavViewController.xib”,其中包含一个表格、一些按钮和自定义导航栏。我希望加载此界面,但它会加载带有空白屏幕的空白导航栏。
我正在做的事情可能吗?我要怎么做才能加载自定义界面??
【问题讨论】:
-
这个导航控制器有根视图控制器吗?
-
很难看到有人继承 UINavigationController。您应该在 XIB 中删除一个,并在代码中为推送初始化一个。
-
@rdelmar 我必须在哪里编写什么代码才能将根视图控制器添加到 NextNavViewController。
-
@CodaFi 我不明白你想说什么。
标签: ios uiviewcontroller uinavigationcontroller