UITabBarItem具有自定义标题颜色和图像 [英] UITabBarItem with custom title color and images
问题描述
我试图在xcode,ios中自定义我的TabBar,但是我发现ppl说这不可自定义!另外,我确实找到了某种解决方案,但它们都没有为我工作。
I`m trying to customize my TabBar in xcode,ios, however I just found ppl saying that this is not customizable! also, i did find some sort of solutions, but none of them are working for me.
我想改变UITabBarItem标题(文字)的颜色,还要更改其中的2个图像,正常图像和所选图像!
我试图在我的UITabBar子视图中迭代,看看我是否找到但有任何成功:
I tried to iterate inside my UITabBar subviews to see if I find something, but any success:
for (UIView *view in [self.tabBarController tabBar].subviews)
{
NSLog(@"Class: %@",[view class]);
}
这个输出是:
2011-05-18 18:15:24.031 EventApp[52235:207] Class: UIImageView
2011-05-18 18:15:24.032 EventApp[52235:207] Class: UITabBarButton
2011-05-18 18:15:24.032 EventApp[52235:207] Class: UITabBarButton
2011-05-18 18:15:24.033 EventApp[52235:207] Class: UITabBarButton
2011-05-18 18:15:24.033 EventApp[52235:207] Class: UITabBarButton
2011-05-18 18:15:24.034 EventApp[52235:207] Class: UITabBarButton
我无法导入UITabBarButton obj来使用它!
and I cannot import that UITabBarButton obj to work with it!
一些解决方案?!我也发布了一些我看过的链接,但是没有用!
Some solution for that?! also I posted some links bellow which I`ve looked, but didnt work!
编辑
我想做的事情就像下面这样:
EDIT What I wanna do is somethink like the follow:
推荐答案
我是其中一个人说它确实不起作用。您必须在Custom UIViewController中重新实现整个功能,该UIVabController充当UITabBar替代品。
And I'm one of the people that says that it really doesn't work. You have to reimplement the whole functionality in a Custom UIViewController which acts as a UITabBar replacement.
就像Twitter for iPhone或Tweetbot一样。
Just like Twitter for iPhone or Tweetbot did.
这篇关于UITabBarItem具有自定义标题颜色和图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!