/**
* 修改主题
*/
-(void)navigationBarThemeInit
{
/** **/
NSDictionary *navbarTitleTextAttributes = @{
NSForegroundColorAttributeName:[UIColor whiteColor] ,
NSFontAttributeName:[UIFont fontWithName:@"Helvetica-Bold" size:20.0]
};
[self.navigationBar setTitleTextAttributes:navbarTitleTextAttributes];
[self.navigationBar setTintColor:[UIColor whiteColor]];
//[[UINavigationBar appearance] setTintColor: UIColorFromRGB(MyBarColor)];
[self.navigationBar setBarTintColor:UIColorFromRGB(MyBarColor)];
//[self.navigationBar setBarTintColor:UIColorFromRGB(0x2BC17A)];
[self.navigationBar setTitleVerticalPositionAdjustment:2 forBarMetrics:UIBarMetricsDefault];
[self.navigationBar setTitleVerticalPositionAdjustment:-1 forBarMetrics:UIBarMetricsDefaultPrompt];
[self.view setBackgroundColor:UIColorFromRGB(DefaultBackgroundColor)];
//隐藏back标题
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60) forBarMetrics:UIBarMetricsDefault];
}
//添加点击title
UIButton * button =[UIButton buttonWithType:UIButtonTypeCustom];
button.frame=CGRectMake(0, 0, 100, 40);
[button setTitle:temp.lastObject forState:UIControlStateNormal];
button.titleLabel.font=[ UIFont fontWithName : @"Helvetica-Bold" size:20 ];
[button addTarget:self action:@selector(clickTitleAction) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.titleView =button;