I am trying to addapt my code to iOS 7.
[[UIBarButtonItem appearance] setTitleTextAttributes:@{
UITextAttributeTextColor: [UIColor colorWithRed:214.0f/255.0f green:210.0f/255.0f blue:197.0f/255.0f alpha:1.0f],
UITextAttributeTextShadowColor: [UIColor colorWithWhite:0.0f alpha:0.750f],
UITextAttributeTextShadowOffset: [NSValue valueWithCGSize:CGSizeMake(0.0f, 1.0f)]
I am getting a few errors, UITextAttributeColor is deprecated
, UITextAttributeTextShadowColor is deprecated
, and UITextAttributeTextShadowOffset is deprecated
.
NSShadow *shadow = [NSShadow new];
[shadow setShadowColor: [UIColor colorWithWhite:0.0f alpha:0.750f]];
[shadow setShadowOffset: CGSizeMake(0.0f, 1.0f)];
[[UIBarButtonItem appearance] setTitleTextAttributes:@{
NSForegroundColorAttributeName: [UIColor colorWithRed:214.0f/255.0f green:210.0f/255.0f blue:197.0f/255.0f alpha:1.0f],
NSShadowAttributeName: shadow]
}];
NSShadow *shadow = [NSShadow new];
[shadow setShadowColor : [UIColor colorWithWhite:0.0f alpha:0.750f]];
[shadow setShadowOffset : CGSizeMake(0.0f, 1.0f)];
[[UITabBarItem appearance] setTitleTextAttributes:
@{
NSFontAttributeName : [UIFont fontWithName:@"AmericanTypewriter" size:10.0f],
NSForegroundColorAttributeName : [UIColor grayColor],
NSShadowAttributeName: shadow
}
forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes:
@{
NSFontAttributeName : [UIFont fontWithName:@"AmericanTypewriter" size:10.0f],
NSForegroundColorAttributeName : [UIColor blackColor],
NSShadowAttributeName : shadow
}
forState:UIControlStateSelected];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With