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

Change TabBar backgound

$
0
0

Hi, I have some code as follows:

    public static TabbedPage GetMainPage ()
    {   
        var profilePage = new ContentPage {
            Title = "Profile",
            BackgroundColor = Color.Red,
            Content = new StackLayout {
                Spacing = 20, Padding = 50,
                VerticalOptions = LayoutOptions.Center,
                Children = {
                    new Entry { Placeholder = "Username" },
                    new Entry { Placeholder = "Password", IsPassword = true },
                    new Button {
                        Text = "Login",
                        TextColor = Color.White,
                        BackgroundColor = Color.FromHex("77D065") }}}
        };

        var settingsPage = new ContentPage {
            Title = "Settings",
        };

        var mainPage = new TabbedPage { Children = { profilePage, settingsPage }, BackgroundImage = "Assets/menuBG.png", };

        return mainPage;
    }

I want to change the background of the tab bar that appears with the page names to be menuBG.png. The code above does not work.

How can this be done?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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