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

Button TextColor

$
0
0

Hello, I have been unable to change the text color of my buttons on Xamarin.forms. I need the text to be white.

var upcomingButton = new Button { 
                    Text = "Upcoming",
                    BackgroundColor = Color.FromHex ("33B9FF"),
                    BorderColor = Color.FromHex ("33B9FF"),
                    BorderWidth = 2,
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    TextColor = Color.FromHex ("FFFFFF")   
                };

However on other pages, I have been able to change the font color without any issue...

var exploreEventsButton = new Button 
        { 
            Text = "Explore Events",
            FontFamily = Device.OnPlatform (
                "Proxima Nova",
                null,
                null
            ), // set only for iOS
            FontSize = 30, 
            BackgroundColor = Color.FromHex("00E88E"),
            VerticalOptions = LayoutOptions.FillAndExpand,
            HorizontalOptions = LayoutOptions.FillAndExpand,
            TextColor = Color.FromHex("FFFFFF")
        };


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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