开发者

Loading a Localized UIImage

开发者 https://www.devze.com 2023-01-17 16:35 出处:网络
I need to load localized images in my i开发者_JAVA技巧OS app, but also have to take into account that they might need to be the ...@2x kind. How can I do this?Corrected Answer

I need to load localized images in my i开发者_JAVA技巧OS app, but also have to take into account that they might need to be the ...@2x kind. How can I do this?


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",@"")];
0

精彩评论

暂无评论...
验证码 换一张
取 消