导航栏不会隐藏

时间:2012-03-28 16:22:46

标签: ios xcode uinavigationbar

我正在试图找出为什么我无法隐藏自定义模态导航控制器中的导航栏。我试过添加这一行:

self.navigationController.navigationBarHidden = YES;

我已将它放在viewdidload中,即初始化程序,但它不会隐藏条形图。这是我的自定义模式的代码:

-(void)launchCustomModal:(id)sender{

    UIButton *buttonClicked = (UIButton *)sender;
    int selection;
    selection = buttonClicked.tag;

    if (selection == 1) {
        modalViewController = [[UINavigationController alloc]initWithRootViewController:[[artistsViewController alloc]initWithNibName:nil bundle:nil]];

    }

    SDJAppDelegate *app = (SDJAppDelegate *) [UIApplication sharedApplication].delegate;

    UIWindow *appWindow = [app window];
    UIView *windowView = [[appWindow subviews] objectAtIndex:0];
    CGRect rect = [[UIScreen mainScreen] applicationFrame];

    syncView = [[UIView alloc]initWithFrame: rect];
    CGRect frame = syncView.frame;
    frame.origin.y = -20.0;
    syncView.frame = frame;

    CATransition *animation = [CATransition animation];

    [animation setDelegate:self];
    [animation setType:kCATransitionMoveIn];
    [animation setSubtype:kCATransitionFromBottom];

    [animation setDuration:0.50];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];

    [[syncView layer] addAnimation:animation forKey:kCATransition];

    [windowView addSubview:syncView];
    [syncView addSubview:modalViewController.view];

    [modalViewController viewDidLoad];
}

任何人有任何想法吗?

0 个答案:

没有答案