我有一个带有从字符代码创建的后箭头的uibarbuttonitem。在iOS4.3及更低版本中,箭头看起来不错,但在iOS5中,它显示的要小得多。有没有人见过这个?除了使用实际图像之外,还知道如何修复它吗?
// flex space
UIBarButtonItem *flex = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
// back
unichar backArrowCode = 0x25C0; //BLACK LEFT-POINTING TRIANGLE
NSString *backArrowString = [NSString stringWithCharacters:&backArrowCode length:1];
UIBarButtonItem *backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:backArrowString
style:UIBarButtonItemStylePlain
target:self
action:@selector(webViewGoBack:)];
[backBarButtonItem setEnabled:NO];
// add
self.toolbarItems = [NSArray arrayWithObjects:backBarButtonItem, flex, nil];
if (self.navigationController != nil) {
[self.navigationController setToolbarHidden:NO];
[self.navigationController.toolbar setTintColor:[UIColor colorForToolBar]];
}
[backBarButtonItem release];
[flex release];
答案 0 :(得分:0)
谢谢Guy Dor!你的评论是正确的。我已经转回使用UIImage了。