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

ResourceDictionary Style does not work

$
0
0

XF 3.6 with Android

public App()
    {

        InitializeComponent();


        var labelStyle = new Style(typeof(Label))
        {
            Setters =
            {
                new Setter {Property = Label.FontSizeProperty,    Value = 60 },
                new Setter {Property = Label.TextColorProperty, Value = Color.FromHex(COLOR_KOELLIKER)}
            }
        };

        var buttonStyle = new Style(typeof(Button))
        {
            Setters =
            {
                new Setter {Property = Button.FontSizeProperty,    Value = 60 },
                new Setter {Property = Button.BackgroundColorProperty, Value = Color.FromHex(COLOR_KOELLIKER)}
            }
        };

        Resources = new ResourceDictionary();
        Resources.Add("labelStyle", labelStyle);
        Resources.Add("buttonStyle", buttonStyle);


        MainPage = new LetturaTelaioPage();
    }

this code does nothing... Label and Button has default styles....


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>