user2240342
user2240342

Reputation: 93

Xamarin.Forms Image in ListView DataTemplate not appearing in WinPhone 8.1

Image XAML component doesn't work when placed in the listview data template in Xamarin.Forms for Windows Phone 8.1. Image appear fine in Android and iOS.

  <ListView x:Name="recipeList" ItemsSource="{Binding Tweets}" HasUnevenRows="true">
  <ListView.ItemTemplate>
    <DataTemplate>
      <ViewCell> 
       <ViewCell.View>                  
        <StackLayout>
          <Image Source="{Binding ImageURI"} />
        </StackLayout>
       </ViewCell.View>
      </ViewCell>
     </DataTemplate>
   </ListView.ItemTemplate>

where ImageURI = "http://some-image-off-the-web.jpg"

Update In UWP the text doesn't even appear! Forget the image, the actual text is invisible. I can see that that each list item is populated using the Visual Studio Live Property Explorer, there is definitely text to display in each list item, its just invisible. I remove the Grid the label is and it works fine. Image still not shown. Do ViewCells not work well in windows?

Upvotes: 0

Views: 1236

Answers (1)

Krish Nallamalli
Krish Nallamalli

Reputation: 11

Take a look at your Image Source in the StackLayout.

    <StackLayout>
      <Image Source="{Binding ImageURI"} />
    </StackLayout>

The quotation marks are not aligned.

Upvotes: 1

Related Questions