【发布时间】:2013-03-30 01:54:17
【问题描述】:
你可以在这里看到它发生:
http://www.screencast.com/t/mSveqUgPe1
与我的问题类似:UIBarButtonItem Custom Background Appearance 'Jumping' after flip transition
这似乎完全是通过外观 api 为UIBarButtonItems 设置自定义字体引起的。
[[UIBarButtonItem appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor colorWithRed:1 green:1 blue:1 alpha:1.0],
UITextAttributeTextColor,
[UIColor colorWithRed:4/255.0 green:4/255.0 blue:4/255.0 alpha:0.5],
UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, 1)],
UITextAttributeTextShadowOffset,
[UIFont fontWithName:@"ProximaNova-Bold" size:16.0],
UITextAttributeFont,
nil] forState:UIControlStateNormal];
如果我只注释掉字体部分,它就可以解决问题。即使使用像 Helvetica 这样的非自定义字体,以这种方式设置也会导致同样的问题。之前调整图像偏移的 hack 不适用于这个,所以尝试寻找另一种解决方法。
【问题讨论】:
标签: cocoa-touch ios6