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.