Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection in StackLayout incorrect padding and margins #6524

Closed
david-maw opened this issue Apr 27, 2022 · 3 comments
Closed

Collection in StackLayout incorrect padding and margins #6524

david-maw opened this issue Apr 27, 2022 · 3 comments
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/android 🤖 platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@david-maw
Copy link

Description

A CollectionView was truncated unexpectedly

Steps to Reproduce

  1. Unzip the project from simple-embeddedcollection.zip
  2. Compile and run it on Windows, you should see this
    simple-embeddedcollection

It is just a layout described like this in XAML:

    <VerticalStackLayout Padding="40">
        <CollectionView>
            <CollectionView.ItemsSource>
                <x:Array Type="{x:Type x:String}">
                    <x:String>Item 1</x:String>
                    <x:String>Item 2</x:String>
                    <x:String>Item 3</x:String>
                </x:Array>
            </CollectionView.ItemsSource>
            <CollectionView.ItemTemplate>
                <DataTemplate>
                    <Grid Margin="50,0,50,0" ColumnDefinitions="*,Auto">
                        <Label Grid.Column="0" Text="{Binding}" FontSize="Large" />
                        <Label Grid.Column="1" Text="$123.45" FontSize="Large"  />
                    </Grid>
                </DataTemplate>
            </CollectionView.ItemTemplate>
        </CollectionView>
    </VerticalStackLayout>

I saw two errors:

  • Setting Padding on the VerticalStackLayout caused the text in Grid column 1 to be truncated at the right margin.
  • The left and right margin settings on the grid seemed to have no effect.

The first one only seemed to happen on Windows, the second happened on Android too.

Version with bug

Release Candidate 1 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, Windows

Affected platform versions

Android 11, Windows 10

Did you find any workaround?

Using Margin instead of Padding and vice versa often helped work around the problem.

Relevant log output

No response

@david-maw david-maw added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Apr 27, 2022
@v-longmin v-longmin added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Apr 27, 2022
@v-longmin
Copy link

Verified repro on windows, not repro on Android 12.0 with VS 17.3.0 Preview 1.0 [32414.199.main]. Repro project:
simple-embeddedcollection.zip

@jsuarezruiz jsuarezruiz added area-controls-collectionview CollectionView, CarouselView, IndicatorView fatal and removed fatal labels Apr 27, 2022
@Redth
Copy link
Member

Redth commented May 3, 2022

Looks fixed to me in main, likely from #6762

@Redth Redth closed this as completed May 3, 2022
@david-maw
Copy link
Author

Thanks @Redth can you tag it to indicate what release I'll likely see the fix in?

@Redth Redth added this to the 6.0.300-rc.3 milestone May 3, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/android 🤖 platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants