Category: custom view

Add images to bar button item in iphone 0

Add images to bar button item in iphone

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