Reputation: 2431
I am setting appearance of UIBarButtonItem using -appearance method. How can I change it back to iOS default appearance? Here I am changing appearance of UIBarButtonItem:
NSDictionary *textAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
[UIColor colorWithHex:0x3A4047],
UITextAttributeTextColor,
[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.0],
UITextAttributeTextShadowColor,
[UIFont fontWithName:@"Helvetica-Bold" size:13.0],
UITextAttributeFont,
nil];
[[UIBarButtonItem appearance] setTitleTextAttributes:textAttributes
forState:UIControlStateNormal];
Now at some point can I revert all that appearance proxies that I have applied to default proxies?
Upvotes: 1
Views: 273
Reputation: 6263
[[UIBarButtonItem appearance] setTitleTextAttributes:nil
forState:UIControlStateNormal];
Upvotes: 1
Reputation: 8588
Create an NSDictionary
with all of the default attributes before you create *textAttributes
. Then when you want to make it default set the attributes to the other NSDictionary
.
Upvotes: 1