In .NET MAUI, ScrollView with nested CollectionView adds unexpected bottom whitespace on iOS – why?

4 weeks ago 22
ARTICLE AD BOX

In Android this layout works fine, but in iOS it creates some extra scrollable white space in the bottom in very special circumstances.

<ScrollView> <VerticalStackLayout Padding="16"> <Label Text="Header" FontSize="24" Margin="0,0,0,16" /> <CollectionView ItemsSource="{Binding Items}" BackgroundColor="LightGray"> <CollectionView.ItemTemplate> <DataTemplate> <Frame Margin="0,0,0,8" Padding="12"> <Label Text="{Binding .}" /> </Frame> </DataTemplate> </CollectionView.ItemTemplate> </CollectionView> </VerticalStackLayout> </ScrollView>

I found an alternate workaround for this but do we have something solid for this like what is the root cause problem here.
Here is the alternate workaround -

<ScrollView> <VerticalStackLayout Padding="16" BindableLayout.ItemsSource="{Binding Items}"> <Label Text="Header" FontSize="24" Margin="0,0,0,16" /> <BindableLayout.ItemTemplate> <DataTemplate> <Frame Margin="0,0,0,12" Padding="12" CornerRadius="10" BackgroundColor="#1F1F1F"> <Label Text="{Binding .}" TextColor="White" /> </Frame> </DataTemplate> </BindableLayout.ItemTemplate> </VerticalStackLayout> </ScrollView>
Read Entire Article