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

ContentPage.BackgroundImage not changable after set to first image.

$
0
0

The background won't change, it will fixed to the first background always even set to another image path ... Is it a bug?

        `var btn = new Button () {
            Text = "Change background 1"
        };
        btn.Clicked += (object sender, EventArgs e) => 
        {
            this.BackgroundImage = GlobalVar.documentsPathBase + "/6/mainmenubg.png";
        };

        var btn2 = new Button () {
            Text = "Change background 2"
        };
        btn2.Clicked += (object sender, EventArgs e) => 
        {
            this.BackgroundImage = GlobalVar.documentsPathBase + "/7/mainmenubg.png";
        };

        var btn3 = new Button () {
            Text = "Set Background empty"
        };
        btn3.Clicked += (object sender, EventArgs e) => {
            this.BackgroundImage = "";
        };

        Content = new StackLayout () {
            Children = {btn, btn2, btn3}
        };`

Viewing all articles
Browse latest Browse all 91519

Trending Articles