//公共函数

//.h
+ (UIView *) changeNavTitleByFontSize:(NSString *)strTitle;

//.m
+ (UIView *) changeNavTitleByFontSize:(NSString *)strTitle
{
    //自定义标题
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0 , 100, 44)];
    titleLabel.backgroundColor = [UIColor clearColor];
    titleLabel.font = [UIFont fontWithName: @"Helvetica" size: 14.0];
    titleLabel.textColor = [UIColor whiteColor];//设置文本颜色
    titleLabel.textAlignment = UITextAlignmentCenter;
    titleLabel.text = strTitle;
    return [titleLabel autorelease];
}


//调用
self.navigationItem.titleView = [ABUtil changeViewTitleFontSize:Localized(@"ChangePassword")];

  

相关文章:

  • 2021-07-24
  • 2021-10-02
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
  • 2022-12-23
猜你喜欢
  • 2021-11-19
  • 2022-12-23
  • 2022-02-07
  • 2021-12-04
  • 2021-08-26
  • 2021-12-29
  • 2021-06-21
相关资源
相似解决方案