xcode IOS:启动图像多语言
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9411308/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
IOS: launch image multiple language
提问by cyclingIsBetter
I have a multiple language app.
My problem is launch image, what's the way to use a launch image according to language of device. Is there something in info.plist
file?
我有一个多语言应用程序。我的问题是启动图像,根据设备语言使用启动图像的方法是什么。info.plist
档案里有东西吗?
回答by Artur Ozierański
The solution is to localize Default.png like any other resource in your project. Select Default.png from project list in Xcode, on the right pane find "Localization" and simply add new localizations. After that you can change the files to be different for all localizations.
解决方案是像项目中的任何其他资源一样本地化 Default.png。从 Xcode 的项目列表中选择 Default.png,在右侧窗格中找到“Localization”并添加新的本地化。之后,您可以将所有本地化的文件更改为不同。
- In project summary pane in Xcode (talking about Xcode 4.2) add launch images for one or both orientations as normally.
- Launch images will appear in your project files list. Select one of them.
- Expand Utilities (the pane on the right), you will see following groups: "Indentity and Type", "Image Properties", "Localization", ... . In localization group click "+" button. You can now add new localization (for example Spanish).
- After that on the left of your file in project list you will see an expand button. Click the button to show files for all localizations.
- Your localized Default.png files will appear in .lproj directories in project directory. You can for example manually swipe the file in en.lproj to change english launch image.
- 在 Xcode 的项目摘要窗格中(谈论 Xcode 4.2),像往常一样为一个或两个方向添加启动图像。
- 启动图像将出现在您的项目文件列表中。选择其中之一。
- 展开实用程序(右侧窗格),您将看到以下组:“身份和类型”、“图像属性”、“本地化”、...。在本地化组中单击“+”按钮。您现在可以添加新的本地化(例如西班牙语)。
- 之后,在项目列表中文件的左侧,您将看到一个展开按钮。单击该按钮可显示所有本地化的文件。
- 您本地化的 Default.png 文件将出现在项目目录的 .lproj 目录中。例如,您可以手动滑动 en.lproj 中的文件以更改英文启动图像。
回答by Tom Walters
Apple's HIG document advises that developers use launch images that don't have any text whatsoever. Take the contacts app for instance, it simply displays an empty UI so the user believes the app to be launching quicker.
Apple 的 HIG 文件建议开发人员使用没有任何文本的启动图像。以联系人应用程序为例,它只是显示一个空的 UI,因此用户相信该应用程序启动得更快。
So I suggest following this approach and removing any traces of language from the launch images.
所以我建议遵循这种方法并从启动图像中删除任何语言痕迹。