Skip to content

[Android][Regression] SwipeItem Text and IconImageSource are vertically misaligned when SwipeView wraps CollectionView #36736

Closed

Description

@kamano1

Description

When a CollectionView is wrapped directly by a SwipeView on Android, the SwipeItem Text and IconImageSource are not positioned relative to the same layout bounds.
The issue can be reproduced by swiping a CollectionView and displaying a SwipeItem that contains both Text and IconImageSource.
In Microsoft.Maui.Controls 10.0.70 and later, the Text and IconImageSource are visibly misaligned because they appear to be vertically centered against different reference heights.
In Microsoft.Maui.Controls 10.0.60, the Text and IconImageSource are positioned together, but they are still centered relative to the visible item content rather than the entire CollectionView area.
From a layout and UX perspective, the SwipeView is attached to the entire CollectionView. Therefore, the SwipeItem content should be centered relative to the entire swipeable area and both Text and IconImageSource should always use the same alignment bounds.

The attached screenshots compare Microsoft.Maui.Controls 10.0.60 and 10.0.70 using CollectionViews containing 1, 5, and 20 items.
Observed results:

  • 10.0.60:
    • Text and IconImageSource are aligned together.
    • Alignment is based on the visible item content area.
Image
  • 10.0.70 and later:
    • Text and IconImageSource are no longer aligned together.
    • Different alignment bounds appear to be used for Text and IconImageSource.
Image

Expected result:

  • The SwipeItem Text and IconImageSource should always remain aligned together.
  • Both should be vertically centered within the entire SwipeView / CollectionView area.
  • The alignment should not change depending on the number of items contained in the CollectionView.

Steps to Reproduce

  1. Create a new .NET MAUI application from the Visual Studio template.

  2. Update Microsoft.Maui.Controls to 10.0.70.

  3. Replace MainPage.xaml with the sample code provided below.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    x:Class="MauiApp2.MainPage"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:model="clr-namespace:MauiApp2">

    <Grid RowDefinitions="Auto,*">
        <HorizontalStackLayout Grid.Row="0" Spacing="10">
            <Button
                x:Name="Btn1"
                Clicked="Btn1_Clicked"
                Text="1Data" />
            <Button
                x:Name="Btn5"
                Clicked="Btn5_Clicked"
                Text="5Data" />
            <Button
                x:Name="Btn20"
                Clicked="Btn20_Clicked"
                Text="20Data" />
        </HorizontalStackLayout>

        <SwipeView Grid.Row="1" Threshold="80">
            <SwipeView.LeftItems>
                <SwipeItems Mode="Execute">
                    <SwipeItem IconImageSource="ic_fluent_arrow_circle_left_24_filled.png" Text="Back" />
                </SwipeItems>
            </SwipeView.LeftItems>

            <CollectionView x:Name="DmyCollectionView">
                <CollectionView.ItemTemplate>
                    <DataTemplate x:DataType="model:TestData">
                        <Label Padding="10" Text="{Binding Name}" />
                    </DataTemplate>
                </CollectionView.ItemTemplate>
            </CollectionView>
        </SwipeView>
    </Grid>
</ContentPage>
  1. Replace MainPage.xaml.cs with the sample code provided below.
using System.Collections.ObjectModel;

public partial class MainPage : ContentPage
{
    public MainPage()
    {
        InitializeComponent();
        InserrItem(5);
    }

    private void Btn1_Clicked(object sender, EventArgs e)
    {
        InserrItem(1);
    }

    private void Btn5_Clicked(object sender, EventArgs e)
    {
        InserrItem(5);
    }

    private void Btn20_Clicked(object sender, EventArgs e)
    {
        InserrItem(20);
    }

    private void InserrItem(int count)
    {
        DmyCollectionView.ItemsSource = null;
        DmyCollectionView.SelectedItem = null;

        List<TestData> dmyList = [];
        for (int i = 0; i < count; i++) dmyList.Add(new TestData($"{i + 1} recode"));
        DmyCollectionView.ItemsSource = new ObservableCollection<TestData>(dmyList);
    }
}

public class TestData(string name)
{
    public string Name { get; set; } = name;
}
  1. Add an SVG image to:
    Resources/Images/ic_fluent_arrow_circle_left_24_filled.svg

  2. Run the application on Android.

  3. After startup, swipe the CollectionView to reveal the SwipeItem.

  4. Observe the vertical positions of the SwipeItem Text ("Back") and IconImageSource.

  5. Press the buttons to switch between 1 item, 5 items, and 20 items and compare the alignment.

  6. Downgrade Microsoft.Maui.Controls to 10.0.60 and repeat the same test.

  7. Compare the results between 10.0.60 and 10.0.70.

※The sample images were obtained from the Visual Studio Image Library.

Link to public reproduction project repository

No response

Version with bug

10.0.70

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

10.0.60

Affected platforms

Android

Affected platform versions

Android Emulator 14/15/16,Pixel9 Android 17

Did you find any workaround?

No.
The only known way to avoid the issue is to downgrade Microsoft.Maui.Controls to 10.0.60.

Relevant log output

No relevant log output.

Activity

  1. added
    t/bug
    on Jul 23, 2026
  2. kamano1 commented on Jul 23, 2026

    @kamano1
    Author

    I made corrections based on the Agentic Labeler's feedback.

  3. HarishKumarSF4517 commented on Jul 23, 2026

    @HarishKumarSF4517
    Contributor

    This issue has been validated in Visual Studio Code 1.129.0 with .NET MAUI versions 10.0.60, 10.0.70 & 10.0.90. It was reproducible from 10.0.70 version on Android platform. I have attached the sample(SwipeViewIssue.zip) and output for reference:

    10.0.60(Issue not reproduced) 10.0.70(Issue reproduced)
    Screen.Recording.2026-07-23.at.1.32.46.PM.mov
    Screen.Recording.2026-07-23.at.1.39.00.PM.mov
  4. added
    s/verified
    s/triaged
    i/regression
    on Jul 23, 2026
  5. added
    partner/syncfusion
    on Jul 23, 2026
  6. added this to the .NET 10 SR10 milestone on Jul 23, 2026
  7. added 2 commits that reference this issue on Aug 1, 2026
    b640a38
    ccb5f55
  8. 3 remaining items

  9. added this to the .NET 10 SR11 milestone on Aug 20, 2026
  10. added 9 commits that reference this issue on Aug 27, 2026
    e3d587d
    73cffbe
    63c7002
    6045819
    7213f68
    184fdff
    64ec18a
    7e9e40e
    2e8540c
  11. kubaflo commented on Oct 12, 2026

    @kubaflo
    Contributor

    Thank you for the report and the investigation details. We are closing this as completed. PR #36820 directly fixes Android SwipeItem icon/text vertical alignment by correcting the forced-height measurement regression, and the SR10 backport adds CollectionView coverage; no contrary fix-containing result is recorded.

    Fixing changes: #36820 (merged into inflight/current).

    This records the merged source changes; it does not imply that the fix is included in every released .NET MAUI package.

    If the original scenario still fails in a build that includes these changes, please comment here with the exact version and reproduction details so we can reopen and investigate. The existing reproduction remains available; a new issue is not required.

  12. locked and limited conversation to collaborators on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-swipeviewi/regressionpartner/syncfusionplatform/androidregressed-in-10.0.70s/triageds/verifiedt/bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions