Reputation: 12431
I have created a new image to be included in a barbutton item as seen below
However, when I try to add the image to the UIBarButtonItem (as seen in code below)
UIBarButtonItem *newQuestionButton = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"doneButton_text"] style:UIBarButtonItemStyleBordered target:self action:@selector(displayNewQuestion)];
I get the following result
What can I do to display the actual color of the text in the original image in the barbutton?
Upvotes: 1
Views: 1346
Reputation: 18488
The reason why it shows as white
is because only alpha values
in the image are used to create the bar button image. Whatever image you provide is converted into a image with shades of white
, based on the alpha values
. The image must be modified to conform to the iOS Human Interface Guidelines
:
You can find the docs here:
Upvotes: 4