调整大小文本以适应navigationItem.backBarButtonItem.title?

时间:2015-04-28 11:18:04

标签: ios uinavigationcontroller uinavigationitem

我有一个名为&#34的UIViewController; La Bolsa al minuto"。当我推送到另一个VC时,我可以看到带有文本的后退按钮"<回到&#34 ;.这是代码:

self.title = @"La Bolsa al minuto";
[self.navigationController pushViewController:detail animated:YES];

如果我缩短标题(一个字母就足够了),后退按钮项目会显示"< La Bolsa al minut"。

self.title = @"La Bolsa al minut";
[self.navigationController pushViewController:detail animated:YES];

有没有办法减少标题大小让我显示完整的标题?

1 个答案:

答案 0 :(得分:0)

在UIViewController中,标题为" La Bolsa al minuto"。

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];

//Title for 1 VC
    self.title = @"La Bolsa al minuto";

//Title for back button
    self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"La Bolsa..."
                                                                             style:UIBarButtonItemStylePlain
                                                                            target:nil
                                                                            action:nil];
}