iOS 7 UITabBar徽章位置

问题描述:

有没有办法在iOS 7中调整UITabBar徽章的位置?徽章现在阻止标签栏图标比我想要的更多。

Is there any way to adjust the position of the UITabBar badge in iOS 7? The badge now blocks the tab bar icon a bit more than I would like.

iOS 6:

iOS 6:

iOS 7:

iOS 7:

如果可能,你能吗?提供设置标签栏图像的方法?

If possible, can you provide the method by which you are setting the tab bar image?

我遇到了同样的问题,并使用 UIImageRenderingModeAlwaysOriginal :

I had the same problem that you did, and fixed it by using UIImageRenderingModeAlwaysOriginal:

UIImage *image = // Your tab bar item image
UIImage *selected = // Your selected tab bar item image

image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
selected = [selected imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

controller.tabBarItem = [[UITabBarItem alloc] initWithTitle:title
                                                      image:image
                                              selectedImage:selected];

干杯!