When I am trying to create anew label on Xamarin.Forms, I get the following Warning:
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'
What this warning means and what I should do?
Use the FontSize
, FontFamily
, and FontAttributes
properties of the Label
class instead.
https://developer.xamarin.com/guides/xamarin-forms/user-interface/text/fonts/
You should just listen to the warning and change it to FontSize
.
In next releases of Xamarin.Forms
this property can be removed and your code no longer will compile.
Marking some method/property as obsolete is very often used by maintainers of libraries to warn users that this particular member can be removed in next releases of library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With