UIButton *butt = [UIButton buttonWithType:UIButtonTypeCustom];
[butt setImage:[UIImage imageNamed:@”history01.png”] forState:UIControlStateNormal];
[butt addTarget:self action:@selector(slected:) forControlEvents:UIControlEventTouchUpInside];
//added the following line
butt.frame = CGRectMake(0, 0, 54-5-5-5, 45-4-4-4);

UIBarButtonItem *aaa = [[UIBarButtonItem alloc]initWithCustomView:butt];

– (void) slected:(UIBarButtonItem *)sender {
xxxViewController *aaa = [[xxxViewController alloc] init];
[self.navigationController pushViewController:aaa animated:YES];
[aaa release];
}

By admin-powenko

Dr. Powen Ko is a teacher and CEO on LoopTek LLC, and like to teaching. if you need to class, please let PowenKo know, he will love to service and sharing. LoopTek web site is www.looptek.com

Leave a Reply