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

FYI: Don't forget the file extension on Icon property filenames

$
0
0

This may be a bug (or if not it should maybe not half-work), but I just had to wrestle an issue with a TabbedPage. It has been working fine in all my iOS 8 testing, but I fired up the iOS 7 simulator and the page wouldn't even show...at all. Just a white blank page. No errors, no exceptions, nothing. I just happened to notice that when I added the children to the TabbedPage I didn't have the file extension (i.e. ".png") on the Icon property. This wasn't an issue on iOS 8, but iOS 7 doesn't like it for some reason.

To recap, this does not work for me on iOS 7, but does on iOS 8...

public class DashboardPage : TabbedPage
{
    public DashboardPage ()
    {
        Children.Add (new StatsCurrentPage {
            Title = "Current",
            Icon = "tab-stats-current"
        });
        Children.Add (new StatsPreviousPage {
            Title = "Previous",
            Icon = "tab-stats-previous"
        });
    }
}

However, this works on both...

public class DashboardPage : TabbedPage
{
    public DashboardPage ()
    {
        Children.Add (new StatsCurrentPage {
            Title = "Current",
            Icon = "tab-stats-current.png"
        });
        Children.Add (new StatsPreviousPage {
            Title = "Previous",
            Icon = "tab-stats-previous.png"
        });
    }
}

Viewing all articles
Browse latest Browse all 58056

Trending Articles