UINavigationBar添加2个UILabel

我有一个自定义UINavigationBar,其中在titleView有两行label

    UILabel *navBarLabel = [[UILabel alloc] initWithFrame:CGRectZero];  
    UINavigationItem *item = [[UINavigationItem alloc] init];  
    navBarLabel.backgroundColor = [UIColor clearColor];
    navBarLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:14];
    navBarLabel.numberOfLines = 2;
    navBarLabel.textAlignment = UITextAlignmentCenter;
    navBarLabel.textColor = [UIColor colorWithRed:124.0/255.f green:125.0/255.f blue:128.0/255.f alpha:1.0];
    navBarLabel.text = @"This\nis an example";
    [navBarLabel sizeToFit];
    item.titleView = navBarLabel;

在UIlabel文本中,需要添加两个UILabel,其中一个在另一个的顶部,分别在每行实现定制字体。能否实现?谢谢。

楼主可以试试这样 将这两个UILabel添加至一个新的UIView中 ,然后将UIView 添加至titleView中,如果移除的话 只需要移除这个UIView