diff --git a/src/Controls/src/Core/Handlers/Items/Android/MauiRecyclerView.cs b/src/Controls/src/Core/Handlers/Items/Android/MauiRecyclerView.cs index adebfc16e999..45c8683d208f 100644 --- a/src/Controls/src/Core/Handlers/Items/Android/MauiRecyclerView.cs +++ b/src/Controls/src/Core/Handlers/Items/Android/MauiRecyclerView.cs @@ -390,6 +390,13 @@ public virtual void ScrollTo(ScrollToRequestEventArgs args) var position = DetermineTargetPosition(args); + // The collection view includes a header at the zeroth index, so the collection view scrolling is not correct using the index. + bool hasHeader = ItemsViewAdapter.ItemsSource.HasHeader; + if (hasHeader) + { + position += 1; + } + if (args.IsAnimated) { ScrollHelper.AnimateScrollToPosition(position, args.ScrollToPosition); diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue27117.xaml b/src/Controls/tests/TestCases.HostApp/Issues/Issue27117.xaml new file mode 100644 index 000000000000..687c248b1ec6 --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue27117.xaml @@ -0,0 +1,56 @@ + + + + + + + + +