c# - Xamarin.Forms 字体已过时

标签 c# xamarin.forms portable-class-library

当我尝试在 上创建新标签时Xamarin.Forms ,我收到以下警告:

about = new Label { Text = "" ,      
                TextColor=Color.Black,
                Font = Font.SystemFontOfSize(16),//Warning occurred here 
                XAlign = TextAlignment.End,
                HorizontalOptions = LayoutOptions.EndAndExpand};

'Xamarin.Forms.Label.Font' is obsolete: 'Please use the Font attributes which are on the class itself. Obsoleted in v1.3.0'



这个警告意味着什么,我应该怎么做?

最佳答案

使用 FontSize , FontFamily , 和 FontAttributes Label 的属性类代替。

https://developer.xamarin.com/guides/xamarin-forms/user-interface/text/fonts/

关于c# - Xamarin.Forms 字体已过时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36039545/

相关文章:

c# - 如何在 .NET 7 中使用 System.Text.Json 序列化多级多态类型层次结构?

c# - 在 asp.net 上使用 ajax 创建动态控件

ios - Xamarin.iOS 上的启动屏幕未显示。而是显示蓝屏

.net - 通过Reflection.Emit生成可移植类库

c# - 如何在 vb.net 中使用 linq 对另一个列表中的列表进行排序

c# - 限制子类继承基类的某些方法

c# - xamarin.droid 中 UITest 的引用问题

c# - xamarin.forms-页面底部的“滑动”信息框

.net - 从桌面应用程序调用 Windows 10 通用类库

android - 使用 Sqlite.net Pcl for Xamarin android 升级数据库