【问题标题】:Xamarin forms iOS apply same font but different styleXamarin 窗体 iOS 应用相同的字体但不同的样式
【发布时间】:2020-05-09 10:43:27
【问题描述】:

我有一个 xamarin 表单应用程序。我想使用来自 Google Fonts 的Roboto Font Family。实际上,Roboto Light 和 Roboto Regular。适用于 iOS 的 Roboto Light 和 Roboto Regular 的名称是什么?

<OnPlatform x:Key="RobotoLightFontFamily" x:TypeArguments="x:String">
    <On Platform="UWP" Value="/Assets/Fonts/Roboto-Light.ttf#Roboto" />
    <On Platform="iOS" Value="Roboto Light" />
    <On Platform="Android" Value="Roboto-Light.ttf#Roboto" />
</OnPlatform>
<OnPlatform x:Key="RobotoRegularFontFamily" x:TypeArguments="x:String">
    <On Platform="UWP" Value="/Assets/Fonts/Roboto-Regular.ttf#Roboto" />
    <On Platform="iOS" Value="Roboto" />
    <On Platform="Android" Value="Roboto-Regular.ttf#Roboto" />
</OnPlatform>

它不是这样工作的...当为每个组件使用每个字体系列时,它只应用一种字体而不是两种字体

【问题讨论】:

    标签: ios xamarin.forms google-font-api roboto


    【解决方案1】:

    经过一些尝试,将其命名为 Roboto-Light 有效。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-19
      • 2012-03-26
      • 1970-01-01
      • 2020-07-22
      • 1970-01-01
      相关资源
      最近更新 更多