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

ListView does not render immediately in Android

$
0
0

I have a button on a page which when clicked calls a method which does

return new NavigationPage(new StadanPage())

This StadanPage constructor, whose class inherits from ContentPage, looks like this:

public StadanPage()
{
Title = "Staðan";

        var accountListView = new AccountListView();
        var billListView = new BillListView();

        var listLayout = new StackLayout
        {
            Children = { 
                accountListView,
                billListView,
            },
            Padding = new Thickness(10, 10, 10, 10),
            Spacing = 10,
            VerticalOptions = LayoutOptions.FillAndExpand,
            BackgroundColor = Colors.BackgroundColor,
        };

        var scrollView = new ScrollView
        {
            Content = listLayout,
        };

        Content = scrollView;
    }

I have no problem on an iOS device, but on Android (Google Galaxy Nexus) the scrollView (the two list views) do not render unless I rotate the device.
Note that removing the scrollView (setting the Content of the StadanPage equal to listLayout) does not change this behaviour.

Any ideas what is going on here?


Viewing all articles
Browse latest Browse all 58056

Trending Articles