我想字體設置爲我的系統,並用它在我的應用程序,它工作正常爲Android,但它並不適用於IOS 設置字體 - 首先我說的.ttf文件到資源在IOS項目我需要從文件名爲.ttf
加入該字體以Entitlements.plist
對於Android,我已新增至資產文件夾
然後在主應用app文件我在字典資源
<Style x:Key="LableStyle" TargetType="Label" >
<Setter Property="Label.FontFamily">
<Setter.Value>
<OnPlatform x:TypeArguments="x:String">
<OnPlatform.Android>
DroidSansArabic.ttf#DroidSansArabic
</OnPlatform.Android>
<OnPlatform.iOS>
DroidSansArabic
</OnPlatform.iOS>
</OnPlatform>
</Setter.Value>
</Setter>
</Style>
添加了這個代碼和標籤我加入了風格類似這樣的
<Label HorizontalOptions="StartAndExpand"
Margin="20,5,0,0"
x:Name="lblForgotPassword"
Text="Forgot Password"
Style="{StaticResource LableStyle}">
</Label>
但它工作正常在Android中但不在IOS中工作爲什麼?
您不需要將其添加到entitlements.plist,但info.plist –