I have a navigation bar that looks like so:

It was created with the following code:
// AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSShadow *textShadow = [[NSShadow alloc] init];
textShadow.shadowBlurRadius = 5.0;
textShadow.shadowColor = [UIColor colorWithWhite: 1.0 alpha: 0.75];
textShadow.shadowOffset = CGSizeMake(0.0, 1.0);
[[UIBarButtonItem appearance] setTitleTextAttributes: @{ NSShadowAttributeName: textShadow } forState: UIControlStateNormal];
return YES;
}
Questions
- Where is the shadowBlurRadius (at least for the "Edit" button)? Notice that I set
textShadow.shadowBlurRadius = 5.0;. Cranking up that value doesn't seem to do anything either. - Is it possible to add a shadow to the "+" bar button item or other bar button items that are not text (e.g. UIBarButtonSystemItemCamera)? I'd like to avoid generating my own rasterized images.
This question pertains to iOS 7 only.
Actually your shadow is getting rendered on
UIBarButonItem& you can see the white shadow in the "Edit" bar button item text. If you want to use better shadow appearance then please try to play with values inCGSizeMakehere within range of -1, 1, 0A bit tricky, but to add shadow to the right bar button item, please make a
UIBarButtonwith title on it as+& assign it to therightBarButtonof navigation Item & you will get the shadow affect as you see in the left bar button item.Hopw that helps.