[英]Load a UINavigationController as a subview from UIViewController
[英]how to load UINavigationController from Uiviewcontroller
我想從我的UIViewController
UINavController
我的界面細節在這里。
@interface ContactUs : UIViewController {
IBOutlet UIWindow *window;
IBOutlet UINavigationController *navController;
}
@property (nonatomic,retain) IBOutlet UINavigationController *navController;
@end
and in implementation ..
@synthesize window;
@synthesize 導航控制器;
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
-(void)viewDidLoad {
[window addSubview:navController.view];
[window makeKeyAndVisible];
[super viewDidLoad];
NSLog(@":::::::::::::::::::");
}
但不幸的是我的UINavigationController
沒有加載。 我看到一個空白的 windows 出現了。 提前感謝
如果您想使用導航視圖 controller 而不是視圖 controller.. 為什么不使用 UINavigationController?
@interface ContactUs : UINavigationViewController {
IBOutlet UIWindow *window;
// IBOutlet UINavigationController *navController; // You do not need this.
}
@interface ContactUs : UINavigationViewController {
IBOutlet UIWindow *window;
IBOutlet UITextView *textView;
IBOutlet UIButton *button;
}
// Add properties to the all outlets //
-(IBAction) buttonpressed: (id) sender;
在實現中 - 為 buttonpressed 編寫代碼,您可以將其用於您的目標。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.