在iOS 7中,长按屏幕标题缺lessbutton标题

当我的屏幕标题很大时,我看到“返回”button标题丢失。 我需要显示整个标题。 有没有解决方法?

请参阅附上我看到与长标题的导航栏的屏幕截图。

在这里输入图像说明

使您的屏幕标题更小。 你可以通过使用一个UILabel的titleView来控制它。 好处是你可以设置它的大小,如果文本太大(而不是像title那样只是增长),它可以截断它的文本和/或使文本占据两行。

 UIView *iv = [[UIView alloc] initWithFrame:CGRectMake(0,0,170,35)]; [iv setBackgroundColor:[UIColor whiteColor]]; _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 170, 35)]; _titleLabel.textAlignment = UITextAlignmentCenter; [_titleLabel setFont:[UIFont boldSystemFontOfSize:16.0]]; [_titleLabel setBackgroundColor:[UIColor clearColor]]; [_titleLabel setTextColor:[UIColor blackColor]]; [_titleLabel setText:@""]; _titleLabel.clipsToBounds = false; iv.clipsToBounds = false; [iv addSubview:_titleLabel]; [self.navigationItem setTitleView:iv]; 

你也需要@property(强,非primefaces)UILabel * titleLabel;