【问题标题】:Yandex MapKit set locale of labelsYandex MapKit 设置标签区域设置
【发布时间】:2019-09-03 07:19:03
【问题描述】:

如何在 mapkit 中设置标签语言环境?

MapKit 不对文本标记使用默认本地化

 mapView.getMap()

不包含合适的方法

【问题讨论】:

    标签: android locale yandex-mapkit


    【解决方案1】:

    我终于做到了

    文档: i18ManagerFactory

    @Override
    public void onStart() {
        super.onStart();
        mapView.onStart();
        MapKitFactory.getInstance().onStart();
        .....
        I18nManagerFactory.setLocale(Locale.getDefault().getLanguage(), new LocaleUpdateListener() {
            @Override
            public void onLocaleUpdated() {
                Log.d(TAG","onLocaleUpdated");
            }
    
            @Override
            public void onLocaleUpdateError(@NonNull Error error) {
                Log.d(TAG,"onLocaleUpdateError");
            }
        });
    }
    

    注意:国家和语言设置由系统偏好决定。并且用户需要重新启动应用程序才能使更改生效。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-08-17
      • 1970-01-01
      • 1970-01-01
      • 2016-07-22
      • 2023-03-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多