我正在使用一些沒有標籤欄的xib,有些使用標籤欄。查看加載問題
在開始我加載沒有標籤欄導航欄的xib然後流程正在working.But如果我加載與標籤欄導航欄的xib然後我們所有的視圖幻燈片波紋管和半選項卡欄不顯示。請任何人幫助我儘快。
Pleaseeee !!!!!!
我正在使用一些沒有標籤欄的xib,有些使用標籤欄。查看加載問題
在開始我加載沒有標籤欄導航欄的xib然後流程正在working.But如果我加載與標籤欄導航欄的xib然後我們所有的視圖幻燈片波紋管和半選項卡欄不顯示。請任何人幫助我儘快。
Pleaseeee !!!!!!
你正在加載一個標籤欄控制器或只是一個標籤欄?使用導航控制器推送視圖後是否正好發生?如果是這樣,同樣的事情發生在我身上(link here),我一直無法修復它。我認爲這是不支持,不推薦蘋果的東西,你可以在NavigationController類參考找到這個:
我所做的是將一個標籤欄(不是標籤欄控制器)添加到正在推送的視圖中,然後以編程方式對其進行配置。你可以在這裏找到一個很好的例子(http://discussions.apple.com/thread.jspa?threadID=2099944&tstart=0),但它會是這樣的:
- (void)activateTab:(int)index {
switch (index) {
case 1:
if (tab1ViewController == nil) {
self.tab1ViewController =
[[Tab1ViewController alloc] initWithNibName:@"Tab1View" bundle:nil];
}
[self.view addSubview:tab1ViewController.view];
if (currentViewController != nil)
[currentViewController.view removeFromSuperview];
currentViewController = tab1ViewController;
break;
case 2:
if (tab2ViewController == nil) {
self.tab2ViewController =
[[Tab2ViewController alloc] initWithNibName:@"Tab2View" bundle:nil];
}
[self.view addSubview:tab2ViewController.view];
if (currentViewController != nil)
[currentViewController.view removeFromSuperview];
currentViewController = tab2ViewController;
break;
default:
break;
}
}
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item {
[self activateTab:item.tag];
}
- (void)viewDidLoad {
[super viewDidLoad];
[myTabBar setSelectedItem:[myTabBar.items objectAtIndex:0]];
[self activateTab:1];
}
你當然需要聲明的標籤欄爲好,三個視圖控制器使用中的位置(tab1ViewController,tab2ViewController和currentVideoController)。
你沒有提供太多的細節,但我希望這可以幫助一點點。