view1 = [[View1 alloc] init]; //Create the first view
UINavigationController *navigationController1 = [[UINavigationController alloc] initWithRootViewController:view1];
navigationController1.navigationBar.tintColor =[UIColor blackColor];
View1继承自UIViewController。所以我创建一个* view1,然后创建一个UINavigationController,调用* navigationController1。我如何将两者联系在一起?非常感谢您如何将UINavigationController添加到代码中的视图中?
可以与根视图INIT:的UINavigationController *导航= [[UINavigationController的页头] initWithRootViewController:yourViewController]; –