Iphone 选项卡栏-选定项阴影

Iphone 选项卡栏-选定项阴影,iphone,ios,uitabbarcontroller,tabbar,uitabbaritem,Iphone,Ios,Uitabbarcontroller,Tabbar,Uitabbaritem,我已经使用CGRectMake增加了选项卡栏的高度,我的问题是:我可以增加阴影(选中时显示在选项卡栏项目上)的高度吗?如何解决呢?对于你的问题,即使我以前没有尝试过,但我认为这是可能的,从这个参考链接,请查看shadowImage讨论 Discussion The default value is nil, which corresponds to the default shadow image. When non-nil, this property represents a custom

我已经使用CGRectMake增加了选项卡栏的高度,我的问题是:我可以增加阴影(选中时显示在选项卡栏项目上)的高度吗?如何解决呢?

对于你的问题,即使我以前没有尝试过,但我认为这是可能的,从这个参考链接,请查看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)亲自发现这一点:)


有关自定义选项卡栏,请参阅本教程和源代码

有多个示例,其中一个用于自定义阴影


希望能对您有所帮助。

谢谢Omar,我将尝试构建一个自定义选项卡栏并返回。再次感谢Omar,提供的链接非常有用,我可以想象如何使用提供的代码?self,tabbar controller.tabbar=[[UITabBar外观]设置阴影图像:[UIImage imagename:@“yourshadowimgWithheight thatyouwant.png”]]??请尝试一下[self.tabBarController.tabBar setShadowImage:[UIImage ImageName:@“yourshadowimgWithheight thatYouwant.png”];你也设置了backgroundImage吗?不,它已经正确了(你需要将backgroundImage与setShadowImage一起使用),但我想知道为什么它不工作,结果是什么?似乎什么都没有发生?当我运行代码时,应用程序崩溃了,我得到了-[UITabBar setShadowImage:]:无法识别的选择器发送到实例0x9493990….***由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:'-[UITabBar setShadowImage:]:未识别的选择器发送到实例0x9493990'***第一次抛出调用堆栈:
[self.tabbarController.tabBar setSelectionIndicatorImage:[UIImage imageNamed:@"Selected_Tab_Shadow.png"]];