简体   繁体   English

标签栏的uiview问题

[英]uiview issue with tab bar

I am working on Xcode 5.1.2 iOS7.My problem is that i want to implement tab bar controller on second view controller . 我正在使用Xcode 5.1.2 iOS7。我的问题是我想在第二个视图控制器上实现选项卡栏控制器。 Tab bar controller is implemented successfully.My all view are slightly transparent which inserts in array to tab bar.when i click on tab bar button,first view is visible at behind of every view of tab bar views.so how i can solve this problem. 标签栏控制器已成功实现。我的所有视图都是透明的,将其插入到标签栏的数组中。当我单击标签栏按钮时,第一个视图在标签栏视图的每个视图的后面都可见。所以我如何解决此问题。

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];

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM