0

I'm trying to generate an UIBarButtonItem with style:UIBarButtonItemStlyePlain, and also with both text and image.

The best solutions I found in this site (this one for example) didn't let me set the style as Plain. In fact, this solution only makes a buttonitem with no stlye, but with both text and image.

That's a good progress to solve what I want, but is there a way to add programmatically that plain stlye?

Community
  • 1
  • 1
FabKremer
  • 2,149
  • 2
  • 17
  • 29

1 Answers1

0

You could create a UIBarButtonItem with a custom view that has both an image and label. You can ask the system for the UIBarButtonItemStlyePlain style properties using UIAppearance protocols.

Example:

UIColor *textColor = [[UIBarButtonItem appearance] titleTextAttributesForState:UIControlStateNormal][UITextAttributeTextColor];

hundreth
  • 841
  • 4
  • 8