Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Styling #26

Closed
Hackmodford opened this issue May 24, 2013 · 4 comments
Closed

Remove Styling #26

Hackmodford opened this issue May 24, 2013 · 4 comments

Comments

@Hackmodford
Copy link
Contributor

I have another case where I actually need to remove the button styling? Is there an easy way to accomplish this?

@jflinter
Copy link
Contributor

Yes. See d797840.

@Hackmodford
Copy link
Contributor Author

I'm missing something. How do I remove the styling? So that a button will look normal?

@Hackmodford
Copy link
Contributor Author

I can't figure out how to remove the styling for some buttons.

@jflinter
Copy link
Contributor

UIAppearance paints in pretty broad strokes (no pun intended) - it's not possible AFAIK to set a UIBarButtonItem's backgroundImage back to nil if you've customized it via an appearance proxy. Other options include (in roughly the order I would attempt them):

  • enclose the buttons you're talking about in a specific UINavigationBar subclass (doesn't have to override anything) and use UIBarButtonItem +configureFlatButtonsWithColor:highlightedColor:cornerRadius:whenContainedIn: to style everything else, while not changing your button of interest.
  • generate default images manually, and set them as background images on your specific item.
  • subclass UIBarButtonItem & override drawRect for the button you don't want to mess with.

If anyone else has a better idea (quite possible), feel free to chime in. Best of luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants