#import "GCViewConreoller.h"
#import "GCTools.h"
#import "GCViewControllerTow.h"
@implementation GCViewConreoller
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
UIButton *btn = [GCTools ButtonViewWithTitle:@"jump two" andUIButtonType:UIButtonTypeCustom andControlState:UIControlStateNormal andBackgroundColor:[UIColor redColor] anPointofX:10 anPointofY:100 andWidth:100 andHeight:20 andSuperView:nil andTag:1];
[self.view addSubview:btn];
[btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
self.view.backgroundColor = [UIColor brownColor];
//设置导航条的样式:
self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
//只有导航条为黑色半透明的情况下才能生效。
self.navigationController.navigationBar.backgroundColor = [UIColor redColor];
//导航条默认的高度是44,宽320
//(UIBarMetrics),设置iphone屏幕模式:横屏,风景模式,竖屏:人像模式。默认是人性模式
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"image2.png"] forBarMetrics:UIBarMetricsDefault];
//导航条不会对背景图片进行压缩,缩小。
//自动裁剪功能,会把状态栏的图片截掉,
self.navigationController.navigationBar.clipsToBounds = YES;
//隐藏导航栏:
// self.navigationController.navigationBarHidden = YES;
//导航栏被隐藏后,视图控制器的视图会向上伸展。44dpi
//动画过度隐藏导航条。
// [self.navigationController setNavigationBarHidden:YES animated:YES];
//注:如果想让导航栏一直隐藏,则需要把导航栏放到视图控制器生命周期活跃的阶段,最好不要放在loadview,或者viewdidload阶段中,因为它们不是每次都会被加载,所以切记!,因为这个是被self调用的,当self转到不活跃状态时,它也不能够再调用函数了。
//
}
-(void)btnClick{
GCViewControllerTow *controller = [[GCViewControllerTow alloc] init];
[self.navigationController pushViewController:controller animated:YES];
}