UINavigation

http://xyyk.iteye.com/blog/739972
http://blog.csdn.net/favormm/article/details/6590746
如果想在root view controller中把UINavigationBar隐藏
UINavigationController的delegate方法:

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {  
    if ( viewController ==  rootViewController) {  
        [navigationController setNavigationBarHidden:YES animated:animated];  
    } else if ( [navigationController isNavigationBarHidden] ) {  
        [navigationController setNavigationBarHidden:NO animated:animated];  
    }  
} 



    UINavigationBar *nav = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, -440, 320, 44)];
    
    UINavigationItem *navItem = [[UINavigationItem alloc] initWithTitle:@"范例"];
    navItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"返回" 
                                                             style:UIBarButtonItemStyleBordered 
                                                            target:self 
                                                                  action:@selector(TouchesDone)] autorelease];
    
    
    [nav setItems:[NSArray arrayWithObject:navItem]];
    [sheet addSubview:nav];


UITabBarController
	|-UITabBar
	|-UIViewController selectedViewController
	|-

UINavigationController
	|-UINavigationBar
	|-UIToolbar
	|-UIViewController	(注意×1)
		|-UITabBarItem
		|-UIBarButtonItem
		|-UINavigationItem
			|-Title
			|-UINavigationBar
			|-backBarButtonItem
			|-leftBarButtonItem
			|-rightBarButtonItem
			|-






你可能感兴趣的:(UI)