Sreejith Sree
Sreejith Sree

Reputation: 3671

Xamarin forms: How to place listview on top of an image?

I have a flowlistview on my project and I need to place it on an image. Following is my XAML code:

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="*" />
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <Image Aspect="AspectFill" HorizontalOptions="FillAndExpand" Grid.Row="0" Source="ic_background_image_xx.png"/>

    <flv:FlowListView 
        Grid.Row="0">
        <flv:FlowListView.FlowColumnTemplate>
            <DataTemplate>
                <StackLayout> 

                </StackLayout>
            </DataTemplate>
        </flv:FlowListView.FlowColumnTemplate>
    </flv:FlowListView>
</Grid>

This code is working fine on the android devices and listview is placed on top of a green background image. But in ios, this feature is not working. Please go through the below screenshot and suggest a solution for ios.

enter image description here

Upvotes: 0

Views: 72

Answers (2)

Lucas Zhang
Lucas Zhang

Reputation: 18861

Cause: ListView in iOS has a default BackgroundColor (White), while in Android the background color of ListView is transparent .

So you just need to set the BackgroundColor of FlowListView as Transparent

<flv:FlowListView   
        BackgroundColor="Transparent"
        Grid.Row="0">

Upvotes: 1

Nikhil
Nikhil

Reputation: 3387

For this you need to set the Grid.RowSpan="2" for the Image.

Upvotes: 0

Related Questions