Xamarin Forms Shell: Dynamically remove FlyoutFooter

262 Views Asked by At

It seems as though hiding the FlyoutFooter with IsVisible doesn't cause the scrollview for the Flyout Items to resize to take up the unused space.

Example:

Footer declaration in .xaml:

<Shell.FlyoutFooter>
    <StackLayout Spacing="0" BackgroundColor="Pink" HeightRequest="200">
        <Button x:Name="btnCloseTip"
                                    Text="X"
                                    Clicked="btnCloseTip_Clicked"/>
    </StackLayout>
</Shell.FlyoutFooter>

Click handler:

    private void btnCloseTip_Clicked(object sender, EventArgs e)
    {
        var footer = (StackLayout)this.FlyoutFooter;
        footer.IsVisible = false;
    }

This hides the pink footer, however the space reserved for the footer is not reallocated to the scrollview that contains the items, leaving a 200 unit high empty space below the scrollable list of flyout items. Is there any way to force the flyout menu to redraw/resize after hiding? I have tried setting the layout bounds to a 0,0,0,0 rectangle as well, which also had the same (no-)effect.

0

There are 0 best solutions below