我有一個TabBarController與4選項卡。當我從一個標籤中推一個ViewController時,該標籤會自動隱藏,並且它在View中什麼都不顯示。但ViewController包含一個包含數據的表格視圖。我也實現了tableview委託。我沒有得到tableview委託日誌。iOS 9.0 Tabbar自動隱藏和viewcontroller消失在推
中的appdelegate didFinishLaunchingWithOptions()self.window = [[ALLOC的UIWindow] initWithFrame:方法[[UIScreen mainScreen]界限]];
負載的TabBar這裏:
myAppDelegate.myTabBarController.selectedIndex = 0;
myAppDelegate.myTabBarController.tabBar.translucent = NO;
myAppDelegate.myTabBarController.tabBar.opaque = YES;
location_select *tab1 = [[location_select alloc] initWithNibName:@"location_select" bundle:nil];
tab1.tabBarItem.image = [UIImage imageNamed:@"Restaurants.png"];
location_select *tab2 = [[location_select alloc] initWithNibName:@"location_select" bundle:nil];
tab2.title = @"Cart";
tab2.tabBarItem.image = [UIImage imageNamed:@"Cart.png"];
Deal_ViewController *tab3 = [[Deal_ViewController alloc] initWithNibName:@"Deal_ViewController" bundle:nil];
tab3.title = @"Deals";
tab3.tabBarItem.image = [UIImage imageNamed:@"Deals.png"];
MoreViewController *tab4 = [[MoreViewController alloc] initWithNibName:@"MoreViewController" bundle:nil];
tab4.title = @"More";
tab4.tabBarItem.image = [UIImage imageNamed:@"More.png"];
myAppDelegate.myTabBarController.viewControllers = [NSArray arrayWithObjects:tab1,tab2,tab3,tab4,nil];
[myAppDelegate.rootNav pushViewController:myAppDelegate.myTabBarController animated:YES];
由表4,我推Profile_ViewController:
Profile_ViewController *vc = [[Profile_ViewController alloc] initWithNibName:@"Profile_ViewController" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:vc animated:YES];
並已我在那裏應用:
myAppDelegate.myTabBarController.hidesBottomBarWhenPushed=NO;
and
[self.tabBarController setHidesBottomBarWhenPushed:NO];
在Profile_ViewController的viewWillAppear中。沒有任何作品。我只看到一個空白的白色屏幕。
你的意思是你想你的應用程序從4選項卡上的一個導航到另一個viewCont? – vaibhav
@jamshed你可以分享更多關於你的應用程序結構的信息嗎?你在你的應用中使用UINavigationController嗎? –
你能分享故事板截圖嗎? –