Forum Xamarin.Forms

Xamain forms: How to remove the Flowlistview bottom empty space?

SreeeeSreeee INMember ✭✭✭✭✭

I am using Flowlistview for showing items. But the flowlistview bottom has some blank space. For removing that I added HeightRequest property.

In Viewmodel

int _nameHeight;

public int NameHeight

{
    get { return _nameHeight; }
    set
    {
        _nameHeight = value;
        OnPropertyChanged("NameHeight");
    }
}
//Setting the height after loading items
NameHeight = NameItems.Count * 45;

Finally in XAML:

HeightRequest="{Binding NameHeight}"

I have 2 flowlistviews aligned vertically on a page. I applied the above binding feature to both flowlistviews, but height is not decreasing. Is there any mistake with this implementation?

Best Answer

  • JarvanJarvan Xamurai
    edited December 2019 Accepted Answer

    The height of FlowListView could be specified by setting HeightRequest. Try to decrease the binding value in your code.

    <flv:FlowListView 
            x:Name="NameMatchImageList"
            HeightRequest="300"
            FlowItemTappedCommand="{Binding ImageItemTappedCommand}"
            FlowItemsSource="{Binding NameMatchImagItems,Mode=TwoWay}"
            FlowColumnCount="2"
            HasUnevenRows="True">
        <flv:FlowListView.FlowColumnTemplate>
            <DataTemplate>
                ...
            </DataTemplate>
        </flv:FlowListView.FlowColumnTemplate>
    </flv:FlowListView>
    <flv:FlowListView>
        ...
    </flv:FlowListView>
    

Answers

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited December 2019 Accepted Answer

    The height of FlowListView could be specified by setting HeightRequest. Try to decrease the binding value in your code.

    <flv:FlowListView 
            x:Name="NameMatchImageList"
            HeightRequest="300"
            FlowItemTappedCommand="{Binding ImageItemTappedCommand}"
            FlowItemsSource="{Binding NameMatchImagItems,Mode=TwoWay}"
            FlowColumnCount="2"
            HasUnevenRows="True">
        <flv:FlowListView.FlowColumnTemplate>
            <DataTemplate>
                ...
            </DataTemplate>
        </flv:FlowListView.FlowColumnTemplate>
    </flv:FlowListView>
    <flv:FlowListView>
        ...
    </flv:FlowListView>
    

Sign In or Register to comment.