从 UITabBarItem 中删除渐变/光泽 [英] Remove gradient/Gloss from UITabBarItem

查看:29
本文介绍了从 UITabBarItem 中删除渐变/光泽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在自定义 UITabBar.我在 UITabBarItem 中使用了我的自定义图像.问题是物品上是否有渐变/光泽.我检查了 Apple 的应用程序商店对其 UITabBarItem 没有任何这种光泽效果.如何从 UITabBarItem 中删除渐变?

I am customizing the UITabBar. I used my custom image in UITabBarItem. The problem is whether there is a gradient/gloss on the item. I checked Apple's app Store didn't had any of this glossy effect on its UITabBarItem. How can i remove gradient from UITabBarItem?

推荐答案

你只需要把清晰的图片放在`yourImage',它可能对你有帮助

You just need to put clear image as `yourImage', it may help you

[[UITabBar appearance] setSelectionIndicatorImage:[UIImage {yourImage}]]

编辑我只是用谷歌搜索了一下,发现了很多类似的问题.你也可以试试下面的代码行

Edit i just googled it and found lot of similar questions. You can also try below code of lines

[[UITabBar appearance] setShadowImage:[UIImage imageNamed:@"Tappbarimage.png"]];

您必须使用此 tabbarMethod setFinishedSelectedImage:withFinishedUnselectedImage:.

You'll have to provide the images yourself to the UITabBarItem with using this tabbarMethod setFinishedSelectedImage:withFinishedUnselectedImage:.

除了使用 UITabBar 的 selectedImageTintColor 外观属性.

There's no other way to affect the processing it does to the images besides changing the color of the gradient with UITabBar's selectedImageTintColor appearance property.

这篇关于从 UITabBarItem 中删除渐变/光泽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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