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]; –