[問題] Tabbar的切換問題
各位好,初學不久想請教關於TabBar的問題,不使用storyboard建立,都用獨立Xib來做
先建立了4個頁面,1個是UITabbarController,3個是UIViewController
在AppDelegate內先寫code
將UIViewController都用UINavigationController包起來,想要讓每一頁都能有導航列
執行後三個BarItem能正常切換頁面
接著想要在page2的部份做成,點下tablerow即可用navigation push到下一個tabbar
這邊有兩個page的Tabbar,也都用NavigationController包著
如附圖... http://ppt.cc/eGII
跑出來的樣子如右下,背景全黑,且一進去切換到的頁面是在第二頁><
也沒有出現能回到上一頁的導航列...
請各位前輩幫幫忙,感激不盡~~~~
附上點擊TableRow的這段code
---------------
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
TBTView2_1* vc1 = [TBTView2_1 new];
UINavigationController* nvc1 = [[UINavigationController
alloc]initWithRootViewController:vc1];
TBTView2_2* vc2 = [TBTView2_2 new];
UINavigationController* nvc2 = [[UINavigationController
alloc]initWithRootViewController:vc2];
vc1.title = @"VC2-1";
vc2.title = @"VC2-2";
nvc1.title = @"NVC 2-1";
nvc2.title = @"NVC 2-2";
self.tabBarController.viewControllers = [NSArray arrayWithObjects:nvc1,
nvc2, nil];
[self.navigationController pushViewController:self.tabBarController
animated:YES];
}
我的想法是用原本建立的TabBarController作修改,然後push過去...
可是失敗了Orz
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 125.227.149.174
※ 文章網址: http://www.ptt.cc/bbs/MacDev/M.1401264422.A.543.html
推
05/28 16:22, , 1F
05/28 16:22, 1F
→
05/28 16:53, , 2F
05/28 16:53, 2F
→
05/28 16:54, , 3F
05/28 16:54, 3F
剛多加了一個新的tabBarController,隱藏原本的
接著push過去就出現了導航列~也沒有nil view的log訊息了,感謝!!!
但畫面還是黑的QQ
→
05/28 18:59, , 4F
05/28 18:59, 4F
→
05/28 19:00, , 5F
05/28 19:00, 5F
謝謝你!!!我會好好研究一下的 Q____O
※ 編輯: psheaven (122.116.165.112), 05/28/2014 20:52:50