How to add BackgroundImage to ListView in Xamarin Forms?

I know that there is no property for the ListView class BackgroundImage- only a property BackgroundColor, but this is not what I'm looking for. Is there a way to add a background image to the ListView so that when it scrolls the image it stays in place, and the tiles simply "move" around the image when scrolling.

Adding an image to ContentPagedoes not work either, since the ListView simply overlays it.

+4
source share
1 answer

Your post is really good, you just skip the double quotes on the Source property

ListView BackgroundColor " Transparent:

<RelativeLayout>
    <Image Source="background.png" 
        BackgroundColor="Transparent" 
        VerticalOptions="CenterAndExpand" 
        HorizontalOptions="CenterAndExpand"/>
    <ListView x:Name="listView" 
        VerticalOptions="CenterAndExpand"
        HorizontalOptions="CenterAndExpand"
        BackgroundColor="Transparent"
              ItemTapped="OnItemTapped"
              ItemsSource="{Binding .}" />
</RelativeLayout>
+4

Source: https://habr.com/ru/post/1679158/


All Articles