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

[Bug] CollectionView ScrollTo Position Is off when Collectionview has a header #11142

Open
rileemallon opened this issue Jun 20, 2020 · 3 comments

Comments

@rileemallon
Copy link

Description

Steps to Reproduce

  1. fork the collectionview sample
  2. add collectionview header
  3. call collectionView.ScrollTo

Expected Behavior

When scrolling to item with scroll position center, the item should be vertically centered within the collectionview area

Actual Behavior

As you increase the height of the header (Can be easily tested by increasing the padding of a label and the vertical centered of the item is no longer centered.

<CollectionView.Header>
   <StackLayout> 
       <Label Text="header" Padding="10,70"></Label>
   </StackLayout>
</CollectionView.Header> 

Basic Information

  • Version with issue: 4.7
  • Last known good version: unknown
  • IDE: rider/visual studio for mac
  • Platform Target Frameworks:
    • iOS: 11.1
  • Nuget Packages:
  • Affected Devices: iOS simulator

Screenshots

with header
without header

Reproduction Link

https://github.com/xamarin/xamarin-forms-samples/tree/master/UserInterface/CollectionViewDemos

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/collectionview/scrolling

Workaround

unknown

@rileemallon rileemallon added s/unverified New report that has yet to be verified t/bug 🐛 labels Jun 20, 2020
@pauldipietro pauldipietro added this to New in Triage Jun 20, 2020
@samhouts samhouts added e/3 🕒 3 and removed s/unverified New report that has yet to be verified labels Jun 26, 2020
@samhouts samhouts added this to Backlog in CollectionView via automation Jun 26, 2020
@samhouts samhouts moved this from New to Ready For Work in Triage Jun 26, 2020
@samhouts samhouts added this to To do in iOS Ready For Work Jun 27, 2020
@samhouts samhouts removed this from Ready For Work in Triage Jun 27, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts samhouts added this to To do in vNext+1 (5.0.0) Aug 13, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
@LelicKAS
Copy link

I have the same problem ....
CollectionView.ScrollTo incorrectly determines any position if the list has a Header and Footer .... Invalid position for any of Start, Center and End ....
Any updates on this issue?

@quentinR0bert
Copy link

I have the same issue on iOS and Android with Xamarin Forms 4.8

@fbmiranda7
Copy link

fbmiranda7 commented Dec 11, 2020

I can confirm that this bug is reproducible on our project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
CollectionView
  
Review Backlog
Development

No branches or pull requests

6 participants