Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading a Localized UIImage

I need to load localized images in my iOS app, but also have to take into account that they might need to be the ...@2x kind. How can I do this?

like image 957
Alexsander Akers Avatar asked Sep 24 '10 13:09

Alexsander Akers


1 Answers

Corrected Answer

[UIImage imageNamed:@"TestImage"] looks first into Resources, if nothing found, it then looks in the lproj dir folders. So you only need to put the localized images into the right folder.

Old Answer

NSLocalizedString should do the trick. See Localizing String Resources.

UIImage *img = [UIImage imageNamed:NSLocalizedString(@"TestImage",@"")];
like image 117
catlan Avatar answered Nov 10 '22 17:11

catlan