navigation bar item button样式

 UIButton *BackBtn = [[UIButton alloc] initWithFrame:CGRectMake(0.0, 100.0, 62.0, 29.0)];
 [BackBtn setImage:[UIImage imageNamed:@"BackBtn.png"] forState:UIControlStateNormal];
 [BackBtn addTarget:self action:@selector(BackAction:) forControlEvents:UIControlEventTouchUpInside];
 UIBarButtonItem *BackBarBtn = [[UIBarButtonItem alloc] initWithCustomView:BackBtn];
 NavBar.topItem.leftBarButtonItem = BackBarBtn;    
 [BackBtn release];
 [BackBarBtn release]; 

 

你可能感兴趣的:(button)