Android的:语言环境(系统语言)变化影响我的应用程序布局我的、语言、应用程序、布局

由网友(堇色素颜)分享简介:我在我的应用程序,一个活动被打开。我preSS home键和变化的语言,从任务管理器中打开我的应用程序。问题:我的活动布局渐宽i'm in my app, one activity is opened. I press home button and change language, from taskmanager...

我在我的应用程序,一个活动被打开。我preSS home键和变化的语言,从任务管理器中打开我的应用程序。问题:我的活动布局渐宽

i'm in my app, one activity is opened. I press home button and change language, from taskmanager opens my app. Problem: my activity layout is getting wide.

在androidmanifest变化相对应的活动:

changes in androidmanifest corresponding to that activity:

请注意:如果我添加的语言环境中的Andr​​oid清单,布局是正确的,但语言不获取即时更新。用户必须关闭该活动,然后重新启动,才语言得到更新。

Note: If i add locale in android manifest, layout is proper, but language is not getting updated immediately. User have to close that activity and then restart, only then language is getting updated.

请给我你的投入。

推荐答案

正如对你的问题的意见,这是正常的行为。

As mentioned in the comment on your question, it is normal behaviour.

在语言环境的变化被认为是配置的相同方向的变化等。

A change in Locale is considered a change of Configuration the same as a change in orientation etc.

您需要重写 onConfigurationChanged 在活动,并从那里重新加载一切。

You need to override onConfigurationChanged in your Activity and reload everything from there.

请注意:您还需要指定安卓configChanges =区域设置活动声明中 AndroidManifest 文件。

NOTE: You will also need to specify android:configChanges="locale" in the Activity declaration in the AndroidManifest file.

阅读全文

相关推荐

最新文章