- (void)setTitleStyle {
// 标题
NSShadow*shadow = [[NSShadowalloc]init];
[shadowsetShadowOffset:CGSizeZero];
[shadowsetShadowColor:[UIColor clearColor]];
NSDictionary *attributes = @{NSShadowAttributeName:shadow,
NSForegroundColorAttributeName:[UIColorwhiteColor],
NSFontAttributeName:[UIFont systemFontOfSize:18.0]};
[self.navigationController.navigationBar setTitleTextAttributes:attributes];
}
#pragma mark - 设置导航栏背景
- (void)setNavBarBackground {
UIImage*bgImg = [CJToolimageWithColor:HEXCOLOR(0x18213f)size:CGSizeMake(kDeviceWidth,64.0)];
[self.navigationController.navigationBar setBackgroundImage:bgImg forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setShadowImage:[CJTool imageWithColor:HEXCOLOR(0x17a8c1) size:CGSizeMake(kDeviceWidth, 2.0)]];
[self.navigationController.navigationBar setTranslucent:NO];
NSArray*viewControllers = [self.navigationControllerviewControllers];
if(viewControllers.count>1) {
[selfsetLeftButton:IMAGE(@"icon_back")];
}
}
网友评论