UIBarButtonItem display image on ios 7.0

February 12, 2014   ·   0 Comments

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];
}

shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
iOS Tutorial9

Amazon

adsbygoogle

Recent Posts

Categories

Amazon