Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Font loading error based on platform

$
0
0

Hi,

I'm trying to follow the same code as found under Working With Fonts. Original:

label.Font = Device.OnPlatform(
iOS: Font.OfSize ("MarkerFelt-Thin", NamedSize.Medium),
Android: Font.OfSize ("Droid Sans Mono", NamedSize.Medium),
WinPhone: Font.OfSize ("Comic Sans MS", NamedSize.Medium)
);

My version:

public static class StyleGuide
{
public static Font SideMenuFont = Device.OnPlatform( iOS: Font.OfSize("Helvetica", 24));
}

The error I receive:

Error CS1502: The best overloaded method match for

Xamarin.Forms.Device.OnPlatform(System.Action, System.Action, System.Action, System.Action)' has some invalid arguments (CS1502)
Error CS1503: Argument
#1' cannot convert Xamarin.Forms.Font' expression to typeSystem.Action' (CS1503) (trkr)

I fail to see any difference compared to the guide here. Any ideas?


Viewing all articles
Browse latest Browse all 58056

Trending Articles