Reputation: 1237
I localized one image named "background.png". I can see there are two images with the same name but for different language. How do I load the image? Just the same as before?
backgroundImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"background.png"]];
It seems that it does not work?
Upvotes: 2
Views: 1563
Reputation: 5050
Assuming you've placed the image in one of the lproj folders, no code change is required. The OS will pick the correct one for the user's language settings.
You can have Xcode move an image into an lproj folder by selecting it in the project navigator, showing the File Inspector, and clicking the "Make localized" button.
For more information, see Image, Sound, and Video Resources.
Upvotes: 3