如何将本地化图像添加到应用程序资源中?
How to add a localized image into an app resources?
我正在尝试添加本地化图像资源,就像教程中那样:https://developer.android.com/training/basics/supporting-devices/languages.html
我努力尝试并搜索了如何做,但我找不到如何做。
在 Android 项目树上,有一个创建新目录的选项,我用我想要的语言创建了一个。该目录在 Android 项目视图中不可见,但在项目视图树中可见。
在此之后,我尝试配置一个新的图像资产,但没有指定语言的选项。
还有创建新资源文件的选项,它有 select 语言的选项,但没有创建图像资产的选项。
那么,我该怎么做呢?
你的 link 是对的...(强调)
To add support for more locales, create additional directories inside res/
. Each directory's name should adhere to the following format:
<resource type>-b+<language code>[+<country code>]
For example, values-b+es/
contains string resources for locales with the language code es
. Similarly, mipmap-b+es+ES/
contains icons for locales with the es
language code and the ES
country code
因此,您可以在某些 res/drawable-b+CODE
或 res/mipmap-b+CODE
目录下添加本地化图像。
I try to configure a new image asset, but there's no option to specify the language
也许不是,但这并不能阻止您将文件移动到正确的位置。
我正在尝试添加本地化图像资源,就像教程中那样:https://developer.android.com/training/basics/supporting-devices/languages.html
我努力尝试并搜索了如何做,但我找不到如何做。
在 Android 项目树上,有一个创建新目录的选项,我用我想要的语言创建了一个。该目录在 Android 项目视图中不可见,但在项目视图树中可见。
在此之后,我尝试配置一个新的图像资产,但没有指定语言的选项。
还有创建新资源文件的选项,它有 select 语言的选项,但没有创建图像资产的选项。
那么,我该怎么做呢?
你的 link 是对的...(强调)
To add support for more locales, create additional directories inside
res/
. Each directory's name should adhere to the following format:<resource type>-b+<language code>[+<country code>]
For example,
values-b+es/
contains string resources for locales with the language codees
. Similarly,mipmap-b+es+ES/
contains icons for locales with thees
language code and theES
country code
因此,您可以在某些 res/drawable-b+CODE
或 res/mipmap-b+CODE
目录下添加本地化图像。
I try to configure a new image asset, but there's no option to specify the language
也许不是,但这并不能阻止您将文件移动到正确的位置。