Repository navigation
Description
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.
- 10.0.70 and later:
- Text and IconImageSource are no longer aligned together.
- Different alignment bounds appear to be used for Text and IconImageSource.
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
-
Create a new .NET MAUI application from the Visual Studio template.
-
Update Microsoft.Maui.Controls to 10.0.70.
-
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>
- 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;
}
-
Add an SVG image to:
Resources/Images/ic_fluent_arrow_circle_left_24_filled.svg -
Run the application on Android.
-
After startup, swipe the CollectionView to reveal the SwipeItem.
-
Observe the vertical positions of the SwipeItem Text ("Back") and IconImageSource.
-
Press the buttons to switch between 1 item, 5 items, and 20 items and compare the alignment.
-
Downgrade Microsoft.Maui.Controls to 10.0.60 and repeat the same test.
-
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
kamano1 commentedon Jul 23, 2026
I made corrections based on the Agentic Labeler's feedback.
HarishKumarSF4517 commentedon Jul 23, 2026
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:
Screen.Recording.2026-07-23.at.1.32.46.PM.mov
Screen.Recording.2026-07-23.at.1.39.00.PM.mov
[Android] SwipeItem Text and IconImageSource are vertically misaligne…
[Android] SwipeItem Text and IconImageSource are vertically misaligne…
3 remaining items
[Android] SwipeItem Text and IconImageSource are vertically misaligne…
[release/10.0.1xx-sr10] Integrate .NET MAUI 10.0.101 VS insertion pay…
[Android] SwipeItem Text and IconImageSource are vertically misaligne…
[Android] SwipeItem Text and IconImageSource are vertically misaligne…
[Android] SwipeItem Text and IconImageSource are vertically misaligne…
[Android] SwipeItem Text and IconImageSource are vertically misaligne…
[Android] SwipeItem Text and IconImageSource are vertically misaligne…
[Android] SwipeItem Text and IconImageSource are vertically misaligne…
[Android] SwipeItem Text and IconImageSource are vertically misaligne…
kubaflo commentedon Oct 12, 2026
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.