4

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..

这看起来相当糟糕,所以现在我正在尝试找到一种方法来删除它或将其更改为更好的匹配颜色。

但是我不知道该怎么做,希望有人能告诉我。

这是我正在谈论的蓝线

在此处输入图像描述

这就是我将图像选择颜色更改为紫色的方式...

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

另一个蓝色轮廓的例子,其中 tabbaricon 放大了

在此处输入图像描述

4

1 回答 1

1

在 iOS 5 中,您可以设置外观方法。

完全按照您希望它们出现的方式创建未选择和选择的图像,然后setFinishedSelectedImage: withFinishedUnselectedImage:iOS 不会对您通过此方法提供的图像应用任何格式。

UIImage *selectedImage = [UIImage imageWithName:@"my_finished_selected_image"];
UIImage *unselectedImage = [UIImage imageWithName:@"my_finished_unselected_image"];
[tabBarItem setFinishedSelectedImage:selectedImage withFinishedUnselectedImage:unselectedImage];
于 2012-12-03T20:34:07.297 回答