@@ -25,12 +25,12 @@ public class FontPageCs : ContentPage
25
25
public FontPageCs ( )
26
26
{
27
27
var label = new Label {
28
- Text = "Hello, Forms!" ,
28
+ Text = "Hello, Xamarin. Forms!" ,
29
29
FontFamily = Device . OnPlatform (
30
30
"SF Hollywood Hills" ,
31
31
null ,
32
- null
33
- ) , // set only for iOS
32
+ @"\Assets\Fonts\SF Hollywood Hills.ttf#SF Hollywood Hills"
33
+ ) , // set for iOS & Windows Phone (Android done in custom renderer)
34
34
VerticalOptions = LayoutOptions . CenterAndExpand ,
35
35
HorizontalOptions = LayoutOptions . CenterAndExpand ,
36
36
@@ -42,10 +42,14 @@ public FontPageCs ()
42
42
) ;
43
43
44
44
var myLabel = new MyLabel {
45
- Text = "MyLabel for Android!" ,
46
45
VerticalOptions = LayoutOptions . CenterAndExpand ,
47
46
HorizontalOptions = LayoutOptions . CenterAndExpand ,
48
47
} ;
48
+ myLabel . Text = Device . OnPlatform (
49
+ "MyLabel for iOS!" ,
50
+ "MyLabel for Android!" ,
51
+ "MyLabel for Windows Phone!"
52
+ ) ;
49
53
myLabel . FontSize = Device . OnPlatform (
50
54
Device . GetNamedSize ( NamedSize . Small , myLabel ) ,
51
55
Device . GetNamedSize ( NamedSize . Medium , myLabel ) , // will get overridden in custom Renderer
0 commit comments