在 Flutter iOS 应用中设置中文字体在 MaterialApp 中设置日语

问题描述

我遇到了一个问题,即 iOS 应用中的文本以中文字体显示。所以我尝试了三种模式。但它不仅适用于构建 iOS 应用程序。在 iOS 模拟器中,所有模式都有效。如何体现本地化?

① 在 supportedLocales 中设置语言环境。

return MaterialApp(
      localizationsDelegates: [
          GlobalCupertinoLocalizations.delegate,GlobalMaterialLocalizations.delegate,GlobalWidgetsLocalizations.delegate,],supportedLocales: [
          const Locale('ja','JP'),const Locale('en',''),.....
    );

②在Text()中设置textStyle

  static const BoldBlack20 = TextStyle(
    fontWeight: FontWeight.bold,fontSize: 20,locale: Locale('ja',);

③在iOS/Runner/info.plist中设置CFBundleLocalizations

<key>CFBundleLocalizations</key>
    <array>
        <string>English</string>
        <string>ja</string>
    </array>

iOS模拟器截图(日文)

enter image description here

iOS app中的截图(中文)

enter image description here

我想展示日文。

这是一个应用设置截图。 ① 在模拟器中

enter image description here

② 在 iPhone 中

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)