[問題] UITabBar的相關問題
想請問一下
我想要的功能為:
有些頁面不要有UITabBar(例如登入畫面),有些頁面則需要
目前想到的為:
1.在AppDelegate.h中利用UINavigationController插入登入頁面(不要有UITabBar)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window.rootViewController = self.tabBarController;
LoginPage *LoginPage_view=[[LoginPage alloc] init];
navController1 = [[UINavigationController alloc] initWithRootViewController:tabBarController];
[navController1 setNavigationBarHidden:NO];
tabBarController.delegate = self;
self.window.rootViewController =navController1;
[navController1 release];
[self.tabBarController.navigationController pushViewController:LoginPage_view animated:NO];//顯示新頁面
[self.window makeKeyAndVisible];
return YES;
}
2.然後我就不知道要怎麼跳到FirstViewController
(希望裡面包含UITabBar+UINavigation)
目前是直接寫在登入畫面的.m檔裡
(一)[self.navigationController popViewControllerAnimated:NO];
<--有UITabBar,但沒有UINavigation,
且在FirstViewController.m設置self.navigationItem.title無效
(二)[self.navigationController pushViewController:FirstViewCtrl1 animated:NO];
<--沒有UITabBar,有UINavigation,但是我覺得他是創造新的一頁,
因為我發現原本UITabBar的那頁還在
所以到底是什麼問題咧?
不過在利用navigationController,我有試過最直覺的addSubView,看今天要用到哪一頁就貼上去,但發現UITabBar.hidden後,就回不去了,所以才改成這種方法
卡了好多天
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.240.191.143
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章