iOS 7 UITabBar徽章位置 [英] iOS 7 UITabBar badge position

查看:93
本文介绍了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 <修复了它/ code>:

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];

干杯!

这篇关于iOS 7 UITabBar徽章位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆