标签栏的uiview问题

时间:2014-09-27 10:12:07

标签: ios objective-c iphone

我正在研究Xcode 5.1.2 iOS7.我的问​​题是我想在第二个视图控制器上实现标签栏控制器。标签栏控制器成功实现。我的所有视图都是略透明的,在数组中插入标签栏。当我点击标签栏按钮时,第一个视图在标签栏视图的每个视图的后面都可见。所以我怎么能解决这个问题

tabbar=[[UITabBarController alloc]init];
                UIViewController *first=[[ViewController alloc]init];
                UIViewController *second=[[SearchViewController alloc]init];
                UIViewController *third=[[Party_partner_ViewController alloc]init];
                UIViewController *Fourth=[[My_GrooveViewController alloc]init];
                UIViewController *Fifth=[[More_ViewController alloc]init];
                UINavigationController *firstNavController = [[UINavigationController alloc] initWithRootViewController:first];
                UINavigationController *firstNavController1 = [[UINavigationController alloc] initWithRootViewController:second];
                UINavigationController *firstNavController2 = [[UINavigationController alloc] initWithRootViewController:third];
                UINavigationController *firstNavController3 = [[UINavigationController alloc] initWithRootViewController:Fourth];
                UINavigationController *firstNavController4 = [[UINavigationController alloc] initWithRootViewController:Fifth];
                NSArray *ver = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."];
                if ([[ver objectAtIndex:0] intValue] >= 7) {
                    self.nav.navigationBar.barTintColor = [UIColor colorWithRed:29/255.0f green:29/255.0f blue:29/255.0f alpha:1.0f];
                    self.nav.navigationBar.translucent = NO;
                }else
                {
                    self.nav.navigationBar.tintColor = [UIColor colorWithRed:29/255.0f green:29/255.0f blue:29/255.0f alpha:1.0f];
                }

                self.nav.navigationBar.topItem.title = @"The Groove";

                    tabbar.viewControllers=[NSArray arrayWithObjects:firstNavController,firstNavController1, firstNavController2,firstNavController3,firstNavController4, Nil];

                AppDelegate  *mainDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
                // UIWindow *window= [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
                [mainDelegate.window addSubview:tabbar.view];

1 个答案:

答案 0 :(得分:-1)

首先,您可以隐藏或删除您的uiview