自定义TabBar上的突出显示图像 [英] Customize Highlight Image on TabBar
问题描述
我想用标签栏上的图像替换普通的高光。
I want to replace the normal highlight with an image on tabbar.
在iOS4和iOS5上最简单的方法是什么?
What is the simplest way to do this on iOS4 and iOS5??
推荐答案
在iOS 5中这非常容易(请参见< a href = http://developer.apple.com/library/ios/documentation/UIKit/Reference/UITabBar_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40007521-CH3-SW4 rel = nofollow noreferrer> Apple的UITabBar文档的自定义外观部分)。
This is super easy in iOS 5 (see the "Customizing Appearance" section of Apple's UITabBar documentation).
如果您的客户坚持使用iOS 4,则必须有点更有创意。考虑子类化 UITabBar
或 UITabBarController
并自己绘制一些。 下面是一个示例(和另一个示例和另一个示例,其中的答案指向名为 BCTabBarController )。所有适合您的潜在解决方案。
If your client is insisting on iOS 4, you'll have to be a bit more creative. Consider subclassing UITabBar
or UITabBarController
and doing some drawing of your own. Here is an example (and another example and another example which has an answer which points to something called BCTabBarController) you can look at. All great potential solutions for you.
这篇关于自定义TabBar上的突出显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!