标签栏 - 选定的项目阴影

时间:2012-11-11 09:55:50

标签: iphone ios uitabbarcontroller tabbar uitabbaritem

我通过使用CGRectMake增加了标签栏高度,我的问题是:我可以增加阴影(选中时显示在标签栏项目上方)高度?怎么样?

2 个答案:

答案 0 :(得分:1)

对于你的问题,我甚至没有尝试过,但我认为有可能,从这个参考链接http://developer.apple.com/library/ios/documentation/UIKit/Reference/UITabBar_Class/UITabBar_Class.pdf,请看看shadowImage讨论

Discussion
The default value is nil, which corresponds to the default shadow image. When non-nil, this property
represents a custom shadow image to show instead of the default. For a custom shadow image to be shown,
a custom background image must also be set using the backgroundImage (page 5) property. If the default
background image is used, then the defaultshadow image will be used regardless of the value of this property

更新:感谢您Muhannad Dasoqie,自己发现:)

[self.tabbarController.tabBar setSelectionIndicatorImage:[UIImage imageNamed:@"Selected_Tab_Shadow.png"]];

答案 1 :(得分:1)

请参阅本教程和自定义标签栏的源代码。

Custom tabbar

有多个示例,并且有一个用于自定义阴影。

希望能帮到你。

相关问题