Navigation

//self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"主页" style:UIBarButtonItemStylePlain target:self action:@selector(backAction)];
  

 UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0,0,60,31)];
 [button setBackgroundImage:[UIImage imageNamed:@"abc.png"] forState:UIControlStateNormal];
    
    UIBarButtonItem *btn = [[UIBarButtonItem alloc] initWithCustomView:button];
    self.navigationItem.rightBarButtonItem = btn;
    
    [button release];
    [btn release];




-(void)backAction
{
 self.navigationController.navigationBarHidden = YES;
    [self.navigationController popViewControllerAnimated:YES];
}


//自定义背景
UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:adressPage];
    [nav.navigationBar setBackgroundImage:[UIImage imageNamed:@"tbar.png"] forBarMetrics:UIBarMetricsDefault];  //设置背景
    [nav.navigationBar setBarStyle:UIBarStyleBlack];


posted @ 2012-12-06 15:31  废弃账号  阅读(118)  评论(0编辑  收藏  举报