0

我试图用 BCTabBar 之类的动画制作 CustomTabBar

我在 AppDelegate 中编写了这段代码

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.   tabBarController.delegate = self;
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    self.tabBarController = [[BCTabBarController alloc] init];
    self.tabBarController.viewControllers = [NSArray arrayWithObjects:[[UINavigationController alloc]
                                                                       initWithRootViewController:[[ProfileViewController alloc] init]],  [[ChargeViewController alloc] init],
                                             [[OffersViewController alloc] init],
                                             [[ContactUsViewController alloc] init],
                                             nil,nil];

    [self.window addSubview:self.tabBarController.view];
    [self.window makeKeyAndVisible];
    return YES;

}

它工作正常但我想删除 RootViewController 中的 NavigationBar 我能做什么?

4

2 回答 2

0

ProfileViewController课堂上写[[self navigationController] setNavigationBarHidden:YES animated:NO];。那应该隐藏导航栏。如果您需要在其他任何地方显示它,您可以再次将其设置为[[self navigationController] setNavigationBarHidden:NO animated:NO];

于 2012-10-24T09:35:31.710 回答
0

你不能隐藏标签栏吗?

- (void)hideTabBar:(BCTabBarController *) tabbarcontroller
{
    for(UIView *view in tabbarcontroller.view.subviews)
    {
        if([view isKindOfClass:[BCTabBarController class]])
        {
            [view setFrame:CGRectMake(view.frame.origin.x, 480, view.frame.size.width, view.frame.size.height)];
        } 
        else 
        {
            [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 480)];
        }
    }
}
于 2012-10-24T08:11:26.510 回答