发布于 2022-10-12 16:56:11
您可以创建locales_config.xml并像这一样在其中添加语言列表。
用户在您的设置中选择语言之后,只需调用而不是在数据库或共享中保存值。
val appLocale: LocaleListCompat = LocaleListCompat.forLanguageTags("xx-YY")
// Call this on the main thread as it may require Activity.restart()
AppCompatDelegate.setApplicationLocales(appLocale)在我看来,您可以保留语言选择器以方便用户使用。
https://stackoverflow.com/questions/73266227
复制相似问题