KEMBAR78
Fix margin related measuring with CV by PureWeen · Pull Request #6762 · dotnet/maui · GitHub
Skip to content

Conversation

@PureWeen
Copy link
Member

@PureWeen PureWeen commented May 2, 2022

Description of Change

  • Android was calling the old Layout method which includes the margins on the bounds. This would then cause the Layout to fill the margin space created.

  • WinUI just needed some additional margins added on the ItemContentControl.

Issues Fixed

Fixes #5621

Results

<CollectionView x:Name="cvMe">
    <CollectionView.ItemTemplate>
        <DataTemplate>
            <StackLayout Margin="20,50,0,0" Background="Purple">
                <Label Text="I am a label with a margin" TextColor="White"></Label>
            </StackLayout>
        </DataTemplate>
    </CollectionView.ItemTemplate>
</CollectionView>

WINUI (this was also broken on Forms)
image

ANDROID
image

@PureWeen PureWeen requested review from hartez and rmarinho May 2, 2022 22:05
@jsuarezruiz jsuarezruiz added platform/android area-controls-collectionview CollectionView, CarouselView, IndicatorView labels May 3, 2022
@PureWeen PureWeen merged commit 9f444b2 into main May 3, 2022
@PureWeen PureWeen deleted the fix_cv_layout_margins branch May 3, 2022 13:14
@dangernme
Copy link

I am still facing this problem in VS22 V17.3.6

@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
@samhouts samhouts added the fixed-in-6.0.300-rc.3 Look for this fix in 6.0.300-rc.3! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-collectionview CollectionView, CarouselView, IndicatorView fixed-in-6.0.300-rc.3 Look for this fix in 6.0.300-rc.3! platform/android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[WinUI] Margin not applied for CollectionView items on WinUI

5 participants