Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] CollectionView Layout issues #12722

Closed
daves1992 opened this issue Nov 3, 2020 · 4 comments
Closed

[Bug] CollectionView Layout issues #12722

daves1992 opened this issue Nov 3, 2020 · 4 comments

Comments

@daves1992
Copy link

daves1992 commented Nov 3, 2020

I noticed since switching to CollectionView from ListView there is multiple layout issues

These issues are apparent when the screen first loads but disappear when you scroll.

XAML:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MaceXamarinSharedStandardProject.Views.SelectionPage"
             x:Name="CPSelectionPage"
             Title ="{Binding Title}"
             Style="{StaticResource contentPage}">
    <ContentPage.Content>
        <StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Padding="0,10,0,0">
            <Entry Text="{Binding FilterText}" IsVisible="{Binding ShowFilter}" Placeholder="Filter" />
            <CollectionView x:Name="lstSelection" SelectionChangedCommand="{Binding SelectionChangedCommand}" SelectedItem="{Binding SelectedItem}" ItemsSource="{Binding SelectionList}" VerticalOptions="FillAndExpand" SelectionMode="Single" ItemSizingStrategy="MeasureAllItems">
                <CollectionView.ItemTemplate>
                    <DataTemplate>
                        <Frame Style="{StaticResource borderFrame}" Padding="1" HasShadow="False" CornerRadius="0" >
                            <Frame Style="{StaticResource backgroundFrame}" Padding="10" HasShadow="False" CornerRadius="0">
                                <StackLayout Orientation="Vertical" >
                                    <Label Text="{Binding ID}" FontAttributes="Bold" Style="{StaticResource textLabel}" />
                                    <Label Text="{Binding Description}" FontSize="Small" Style="{StaticResource detailLabel}" />
                                </StackLayout>
                            </Frame>
                        </Frame>
                    </DataTemplate>
                </CollectionView.ItemTemplate>
            </CollectionView>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>

Issue:
CollectionView

  • Version with issue: 4.8.0.1560

  • Last known good version: Unknown

  • IDE: VS 4.8.04084

  • Affected Devices:
    Seems to only affect IOS

@daves1992 daves1992 added s/unverified New report that has yet to be verified t/bug 🐛 labels Nov 3, 2020
@rmarinho
Copy link
Member

rmarinho commented Nov 3, 2020

Hi @daves1992 thanks for your report, is it possible to upload a small repro of the issue so we can investigate better the problem?!

Thanks

@rmarinho rmarinho added a/collectionview s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Nov 3, 2020
@ClaytonIndustries
Copy link

ClaytonIndustries commented Nov 3, 2020

@rmarinho You can repro this easily by creating a collection view where the items are different heights. ItemSizingStrategy="MeasureAllItems" doesn't seem to work properly on iOS, pretty sure this issue has been raised many times before, links to just a few of them

#12554
#11511
#11011
#10842

@rmarinho
Copy link
Member

rmarinho commented Nov 5, 2020

Tested with 4.8.0.1560 and 5.0.0-pre3
Seems i can reproduce this , and this happens with and without ItemSizingStrategy="MeasureAllItems"

on load:
image

after i scroll :
image

@rmarinho rmarinho added p/iOS 🍎 and removed s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. s/unverified New report that has yet to be verified labels Nov 5, 2020
@hartez
Copy link
Contributor

hartez commented Feb 8, 2021

This is fixed in 5.0.0.1931.

@hartez hartez closed this as completed Feb 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants