简体   繁体   English

如何使用NSString更改标签栏图像?

[英]How to change the tab bar image using NSString?

I have a application with custom tab bar, and i can't change the image, the title i can.. 我有一个带有自定义标签栏的应用程序,但是我不能更改图像,标题可以..

UIImage* item0image = [[UIImage imageNamed:[NSString stringWithFormat:@"%@", self.iconoTabMoneda1]]
                       imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
UIImage* item1image = [[UIImage imageNamed:[NSString stringWithFormat:@"%@", self.iconoTabMoneda2]]
                       imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

item0.selectedImage = item0image;
item1.selectedImage = item1image;

尝试将后缀“ .png”或“ .jpeg”(无论是哪个)添加到图像名称。

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

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