简体   繁体   中英

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?

Take a look at your Image Source in the StackLayout.

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

The quotation marks are not aligned.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM