Remove blue outline from uitabbaritem image

I changed tabBar.selectedImageTintColor to my own magenta, however when the tab item is selected there is a bright blue line that surrounds the outside of the image, which is now purple.

This looks pretty bad, so now I'm trying to find a way to remove it or change it to a better color.

However, I do not know how to do this, and I hope someone will tell me.

This is the blue line I'm talking about

enter image description here

This is how I changed the highlight color of the image in 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 a blue outline with expanded tabbaricon

enter image description here

+4
source share
1 answer

In iOS 5, there are display methods that you can install.

Create your unselected and selected images exactly the way you want them to be displayed, and then setFinishedSelectedImage: withFinishedUnselectedImage: iOS will not apply any formatting to the images you provide with this method.

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

Source: https://habr.com/ru/post/1416503/


All Articles