简体   繁体   English

从uitabbaritem图像中删除蓝色轮廓

[英]remove blue outline from uitabbaritem image

I have changed the tabBar.selectedImageTintColor to my own purlple color however when the tabbar item is selected there is a bright blue line that surrounds the outside of the image which is now purple.. 我已经将tabBar.selectedImageTintColor更改为我自己的purlple颜色但是当选择tabbar项时,有一条明亮的蓝线围绕图像的外部,现在是紫色..

This looks fairly bad, so now I am trying to find a way to either remove it or change it to a better matching color. 这看起来相当糟糕,所以现在我试图找到一种方法来删除它或将其更改为更好的匹配颜色。

However I don't know how to do it and am hoping someone can tell me. 但是我不知道怎么做,希望有人能告诉我。

This is the blue line I am talking about 这是我所说的蓝线

在此输入图像描述

This is how I changed the image selection color to purpule... 这就是我将图像选择颜色改为purpule的方法......

 myTabBar.selectedImageTintColor = [UIColor colorWithRed:49.0/255.0 green:0.0/255.0 blue:98.0/255.0 alpha:0.95];

another example of the blue outline with tabbaricon scaled up 另一个用tabbaricon放大的蓝色轮廓的例子

在此输入图像描述

In iOS 5, there are appearance methods that you can set. 在iOS 5中,您可以设置外观方法。

Create your unselected and selected images exactly as you want them to appear and then setFinishedSelectedImage: withFinishedUnselectedImage: iOS will not apply any formatting to the images you provide through this method. 完全按照您希望的方式创建未选择和选定的图像,然后设置setFinishedSelectedImage: withFinishedUnselectedImage: iOS不会对通过此方法提供的图像应用任何格式。

UIImage *selectedImage = [UIImage imageWithName:@"my_finished_selected_image"];
UIImage *unselectedImage = [UIImage imageWithName:@"my_finished_unselected_image"];
[tabBarItem setFinishedSelectedImage:selectedImage withFinishedUnselectedImage:unselectedImage];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM