斯图尔特,因为你有 setTitle:@"" 导航栏按钮将不会显示文本“添加”,而是占用分配给文本的空间。我还没有找到合适的解决方案,但你的解决方法问题是将字体大小设置为0.1f。这将解决您的问题..
需要在AppDelegate.m的“application:didFinishLaunchingWithOptions”方法中设置导航栏的外观,尝试添加如下代码:
UIImage *buttonback = [[UIImage imageNamed:@"nav_back"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 22, 0, 0)];
[[UIBarButtonItem appearance]
setBackButtonBackgroundImage:buttonback forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setTitleTextAttributes:[NSDictionary
dictionaryWithObjectsAndKeys:[UIColor whiteColor],
UITextAttributeTextColor, [UIFont fontWithName:@"verdana" size:0.1f],
UITextAttributeFont, nil] forState:UIControlStateNormal];
另请注意,这将适用于 iOS 6,正在寻找与 iOS 5 兼容的解决方案