dotnet / dotnet/maui

[.NET 10, iOS, Android] CollectionView KeepLastItemInView does not work

Open
#35,802 2 comments 1 reaction 0 assignees View on GitHub
area-controls-collectionview platform/android platform/ios s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 10h
Merged PRs (30d)
297

Description

### Description

Hello,

we are using the latest .NET Maui Controls (10.0.70) for our App and we also tested with a pre-release version of .NET Maui Controls (10.0.80-ci.pr29255.26307.1). We have a problem with the CollectionView and the Property "ItemsUpdatingScrollMode". We want to set the Property "ItemsUpdatingScrollMode" to "KeepLastItemInView" directly inside the .xaml file. Because if we add new items to the CollectionView the CollectionView should always keep the last item inside the view.

If we test this behavior for android, then the CollectionView always scrolls to the top of the CollectionView if a new item is added.
For iOS the CollectionView holds the current scroll position.

This is not what we expected with the option "KeepLastItemInView".

At the moment we are not able to release a new version with Maui.Controls for .NET 10 because this issue is blocking us.

If you need further information, please let me know.

iOS Device:

https://github.com/user-attachments/assets/4a82ae19-e5f4-43c1-9a41-5f25e69c875e

Android Device:

https://github.com/user-attachments/assets/786b91d4-cb21-447d-8e15-1b1eaa3405d2

### Steps to Reproduce

1. Open the CollectionViewKeepLastItemInView.slnx file
2. Start debugging the project with iOS and with Android
3. Press "Add item"
4. A new item will be added to the CollectionView
5. Press "Add itme" till the complete screen of the CollectionView is filled with items
6. Scroll at the end of the CollectionView and press again "Add item"
7. The Scrollbar scrolls to the top and not to the end of the CollectionView for android
8. The CollectionView holds the current position of the scrollbar for iOS

### Link to public reproduction project repository

https://github.com/pwegener993/CollectionViewKeepLastItemInView

### Version with bug

10.0.70

### Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms, Not sure, did not test other versions

### Last version that worked well

Unknown/Other

### Affected platforms

iOS, Android

### Affected platform versions

iOS 18.4 till iOS 26.5, Android 16 and newer

### Did you find any workaround?

No, there is no workaround. I tried it with the "ScrollTo" method, but there is another bug for iOS.

### Relevant log output

```shell

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.