使用以下代码是用于把应用语言环境转换成汉语,程序在一些设备上能正常的运行,但是在另外一些设备上,它把程序中的视图都放大了。这是为什么呢?谁能给点建议啊?
Configuration config = getResources().getConfiguration();
Locale locale = new Locale("es", "es_ES"); // change this to a different Locale than your device
config.locale = locale;
Locale.setDefault(locale);
getBaseContext().getResources().updateConfiguration(config, getResources().getDisplayMetrics());
Log.i("onSelected..", Locale.getDefault().getCountry());
startActivity(new Intent(getApplicationContext(), HomePage.class));
finish();