Remove gradient/Gloss from UITabBarItem

a 夏天 提交于 2019-12-11 23:08:23

问题


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?


回答1:


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"]];

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

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.



来源:https://stackoverflow.com/questions/16979121/remove-gradient-gloss-from-uitabbaritem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!