c# - 添加了 FontFamily 但 Xamarin 中没有变化
问题描述
我正在尝试在我的 Xamarin 应用程序中使用 FontFamily。我下载了字体并将其添加到项目中,但仍未对文本进行更改。
Mobile.App:字体(文件夹)
catamaran-regular.tff
移动应用程序:AssemblyInfo.cs
using Xamarin.Forms;
[assembly: ExportFont("catamaran-regular.ttf")]
移动应用程序:应用程序.xml
<Style
TargetType="Label"
ApplyToDerivedTypes="true">
<Setter Property="FontFamily" Value="catamaran-regular" />
</Style>
Mobile.App.Views:Page.xml
Label
Text="Hello World!"
FontSize="18"
FontFamily="catamaran-regular">
</Label>
解决方案
推荐阅读
- java - 在 Apache Camel 处理器中调用 java 过滤器的方法
- r - 在 R 中转换正确的日期格式
- sql - 基于多列识别重复行
- python - 如何在 keras 中将回归输出限制在 0 到 1 之间
- ios - 编辑时直接在键盘上方显示文本字段
- android - 如何从firebase android getValue()中检索正确的子类型
- jenkins - 在 jenkins 管道中使用 bash 从 package.json 中提取版本
- android - 如何用另一个按钮替换 Android 操作栏中的现有按钮?
- assembly - 长模式 1GB 分页
- r - 将按小时分组的稀疏数据行合并在一起