导航条的下方加上阴影
@interface UINavigationBar (JTDropShadow)
(void)dropShadowWithOffset:(CGSize)offset
radius:(CGFloat)radius
color:(UIColor *)color
opacity:(CGFloat)opacity;
@end
#import "UINavigationBar+JTDropShadow.h"
@implementation UINavigationBar (JTDropShadow)
(void)dropShadowWithOffset:(CGSize)offset
radius:(CGFloat)radius
color:(UIColor *)color
opacity:(CGFloat)opacity {
CGMutablePathRef path = CGPathCreateMutable();
CGPathAddRect(path, NULL, self.bounds);
self.layer.shadowPath = path;
CGPathCloseSubpath(path);
CGPathRelease(path);
self.layer.shadowColor = color.CGColor;
self.layer.shadowOffset = offset;
self.layer.shadowRadius = radius;
self.layer.shadowOpacity = opacity;
self.clipsToBounds = NO;
}
@end