Category: barbutton

Add images to bar button item of toolbar in iphone 0

Add images to bar button item of toolbar in iphone

Set the button type as custom. UIButton *button =  [UIButton buttonWithType:UIButtonTypeCustom];[button setImage:[UIImage imageNamed:@”myImage.png”]  forState:UIControlStateNormal];[button addTarget:self action:@selector(blah)  forControlEvents:UIControlEventTouchUpInside];[button setFrame:CGRectMake(0, 0, 32, 32)];self.navigationItem.rightBarButtonItem =   [[UIBarButtonItem alloc] initWithCustomView:button];