Forum Xamarin.Forms


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

No images in a grid inside a listview on Windows Phone

Hello Everyone,

I'm using Xamarin Forms version and running into a strange problem.
I have a simple listview with a data template that shows an image and a name. It works perfect on android, but not on windows phone.

<ListView x:Name="Sheets" RowHeight="128" VerticalOptions="FillAndExpand" IsPullToRefreshEnabled="true" Refreshing="DataRefreshing"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="0.55*" /> <ColumnDefinition Width="0.45*" /> </Grid.ColumnDefinitions> <Image Grid.Column="0" Source="DefaultWhiteSheetIcon.png" HeightRequest="128" WidthRequest="128" /> <Label Grid.Column="1" Text="{Binding Name}" /> </Grid> </ViewCell> </DataTemplate> </ListView.ItemTemplate> </ListView>

If I use a stacklayout inside the list, everything works.
I checked the datatemplate outside the list, and that works. Just not inside the data template for my listview.

Any thoughts? Is this a bug, or not supported on Windows Phone?


  • JohnHardmanJohnHardman GBUniversity admin
    edited May 2016

    @Daermegil -

    It looks like a bug to me. Using, I am finding that UWP and WinRT 8.1 have issues in this scenario. Using a DataTemplate with hard-coded values (so no bindings), I find that some ViewCells show the expected image and some do not. If I update ItemsSource, it usually rectifies the problem, but not always.

    The attached image shows (with garish colors whilst re-factoring) multiple rows in a ListView, where every row should currently look the same, but the images are missing from some cells. It does seem that where an image is missing, all images for that particular cell are missing (there should be a round-cornered box in the lime box at the left, and should be a down arrow at the right).

    I've just checked Bugzilla - this appears to have already been reported (possibly multiple times).

  • JohnHardmanJohnHardman GBUniversity admin

    Correction - within one ViewCell, some images can be drawn and others not drawn.

  • BevanDiproseBevanDiprose NZMember

    I'm waiting for this bug to be resolved as well....

  • NMackayNMackay GBInsider, University admin

    I was seeing the same issue.

    You can get round it in the interim by using FFImageLoading.

    <ContentPage xmlns=""
                      <ColumnDefinition Width="32" />
                      <ColumnDefinition Width="*" />
                          <OnIdiom x:TypeArguments="GridLength" Tablet="160" Phone="90" />
                      <ColumnDefinition Width="44" />
                      <RowDefinition Height="*" />
                      <RowDefinition Height="*" />
                      <RowDefinition Height="*" />
                        <OnPlatform x:TypeArguments="ImageSource" iOS="IconVessInd" Android="IconVessInd" WinPhone="Images/IconVessInd.png" />
                        <OnPlatform x:TypeArguments="LayoutOptions" iOS="Fill" Android="Fill" WinPhone="Center" />

Sign In or Register to comment.