-------------------------------------------------------------------------
//(初始化)导航栏竖屏44,还有20的标题,横屏32
//iPhone : 竖屏 44 横屏 32,iPad: 44
// 导航栏透明度 ( 默认半透明 )
navVC.navigationBar.translucent = NO;
// 返回键的颜色
navVC. navigationBar . tintColor = [ UIColor whiteColor ];
//导航栏背景色
navVC.navigationBar.barTintColor = [UIColor greenColor];
//是否隐藏导航栏
navVC.navigationBarHidden = NO ;
UINavigationController * navVC = [[UINavigationController alloc] initWithRootViewController:firstVC];
// 导航栏透明度 ( 默认半透明 )
navVC.navigationBar.translucent = NO;
// 返回键的颜色
navVC. navigationBar . tintColor = [ UIColor whiteColor ];
//导航栏背景色
navVC.navigationBar.barTintColor = [UIColor greenColor];
//是否隐藏导航栏
navVC.navigationBarHidden = NO ;
//导航栏设置背景图
//如果图片的尺寸是320*44,则图片显示在导航栏上
//如果图片尺寸是320* 64,则图片从状态栏开始显示
//如果两个都不是,则从状态栏开始平铺图片
[navVC.navigationBar setBackgroundImage:[UIImage imageNamed:@"title_bg.png"] forBarMetrics:UIBarMetricsDefault];
// 设置背景色 , 不设可能产生 BUG;
self.view.backgroundColor = [UIColor redColor];
//设置标题
self.navigationItem.title = @"首页";
//在导航栏添加按钮
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks target:self action:@selector(bar)] autorelease];
//如果图片的尺寸是320*44,则图片显示在导航栏上
//如果图片尺寸是320* 64,则图片从状态栏开始显示
//如果两个都不是,则从状态栏开始平铺图片
[navVC.navigationBar setBackgroundImage:[UIImage imageNamed:@"title_bg.png"] forBarMetrics:UIBarMetricsDefault];
// 设置背景色 , 不设可能产生 BUG;
self.view.backgroundColor = [UIColor redColor];
//设置标题
self.navigationItem.title = @"首页";
//在导航栏添加按钮
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks target:self action:@selector(bar)] autorelease];
//法二
self.navigationItem.rightBarButtonItem = self.editButtonItem;
- (void)setEditing:(BOOL)editing animated:(BOOL)animated
{
[super setEditing:editing animated:animated];
[self.tabBarController setEditing:editing animated:YES];
{
[super setEditing:editing animated:animated];
[self.tabBarController setEditing:editing animated:YES];
}
// 是否隐藏返回按钮
self.navigationItem.hidesBackButton = YES;
//推向下一页
// 是否隐藏返回按钮
self.navigationItem.hidesBackButton = YES;
//推向下一页
[self.navigationController pushViewController:deta animated:YES];
//几种翻页时效果(魔态)[枚举]
deta.modalTransitionStyle = UIModalPresentationPageSheet;
//点按钮弹出一个视图或视图控制器(魔态)
[self presentViewController:detaVC(下一页面) animated:YES completion:^{NSLog(@"finishi ");}];
[self presentViewController:detaVC(下一页面) animated:YES completion:^{NSLog(@"finishi ");}];
//到下一页返回(
取消弹出)
- (void)dismissPage
{
[self dismissViewControllerAnimated:YES completion:^{}];
}
{
[self dismissViewControllerAnimated:YES completion:^{}];
}
//返回到首页
[ self . navigationController popToRootViewControllerAnimated : YES ];
[ self . navigationController popToRootViewControllerAnimated : YES ];
//返回到上一层
[self.navigationController popViewControllerAnimated:YES];
[self.navigationController popViewControllerAnimated:YES];
//返回到指定界面
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:1] animated:YES];
//再所有页面中找到tabView,reloadData刷新页面
NSArray *allControllers = self.navigationController.viewControllers;
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:1] animated:YES];
//再所有页面中找到tabView,reloadData刷新页面
NSArray *allControllers = self.navigationController.viewControllers;
//找到指定页面
UITableViewController *tableViewController = [allControllers objectAtIndex:[allControllers count]-2];
[tableViewController.tableView reloadData];//刷新页面
UITableViewController *tableViewController = [allControllers objectAtIndex:[allControllers count]-2];
[tableViewController.tableView reloadData];//刷新页面