add image to UIBarButtonItem using initWithImage:(UIImage *)image
问题 I would like to know how to set an image to a UIBarButtonItem which will then be added to a UIToolbar, by using InitWithImage when creating a UIBarButtonItem. I am doing the following, but it creates a blank whitespace where the image should be on the UIToolbar UIImage *image = [UIImage imageNamed:@"6.png"]; UIBarButtonItem *systemItem1 = [[UIBarButtonItem alloc] initWithImage:image style:UIBarButtonItemStylePlain target:self action:@selector(pp:)]; Thank You! 回答1: Here's an example that