項目中須要標籤欄和導航結構並存,其實在真正的iphone風格的程序裏並很少見,思考了很久如何嵌套這個結構。
需求:
標籤欄上三個標籤依次表示在線訂購/訂單管理/系統設置.而在線訂購和訂單管理頁面上又有導航欄能夠切換頁面.
實現:
最終實現結構如圖所示,
標籤欄級別高,tab view controller的view controller包含三個view controller,並且要將這三個controller的class選爲navigation controller(可選項還有view controller/table view controller/p_w_picpath picker controller),再單獨實現order online view controller便可。
詳細結構參見下圖
在點擊導航欄上按鈕時生成一個下一頁面的controller並壓入棧中便可,代碼以下: ChkViewController *chkViewController = [[ChkViewController alloc]initWithNibName:@"ChkViewController" bundle:nil]; [self.navigationController pushViewController:chkViewController animated:YES];