Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1ff9c3b
Fixed the indicator shape issue.
NanthiniMahalingam Aug 12, 2025
3a8865c
Updated the fix
NanthiniMahalingam Aug 21, 2025
88dff43
Added the test case
NanthiniMahalingam Aug 22, 2025
fd9e1ff
Updated the test case
NanthiniMahalingam Aug 22, 2025
544c099
Added the order to UItest case.
NanthiniMahalingam Aug 22, 2025
a31f90a
Updated the fix
NanthiniMahalingam Aug 22, 2025
9d6a6bf
Added the output images
NanthiniMahalingam Aug 22, 2025
4ca22f8
Updated the fix
NanthiniMahalingam Aug 28, 2025
29502ff
Updated the code changes.
NanthiniMahalingam Sep 9, 2025
0e73bb5
Updated the test case
NanthiniMahalingam Aug 22, 2025
e12ca60
Added the order to UItest case.
NanthiniMahalingam Aug 22, 2025
ec7c27e
Updated the fix
NanthiniMahalingam Aug 28, 2025
3a78399
Updated the code changes.
NanthiniMahalingam Sep 9, 2025
3ea5b2e
Added the output images
NanthiniMahalingam Jan 2, 2026
45396c2
updated removed code
SubhikshaSf4851 Apr 13, 2026
fa7c0e4
Fixed the indicator shape issue.
NanthiniMahalingam Aug 12, 2025
1cd1bf8
Updated the fix
NanthiniMahalingam Aug 21, 2025
27c343c
Added the test case
NanthiniMahalingam Aug 22, 2025
068614c
Updated the test case
NanthiniMahalingam Aug 22, 2025
129ae7c
Added the order to UItest case.
NanthiniMahalingam Aug 22, 2025
46e9c0a
Updated the fix
NanthiniMahalingam Aug 22, 2025
f714ffd
Updated the fix
NanthiniMahalingam Aug 28, 2025
64f1928
Updated the code changes.
NanthiniMahalingam Sep 9, 2025
c8b9aed
Updated the test case
NanthiniMahalingam Aug 22, 2025
07970a2
Added the order to UItest case.
NanthiniMahalingam Aug 22, 2025
2c76f87
Updated the fix
NanthiniMahalingam Aug 28, 2025
c982508
Updated the code changes.
NanthiniMahalingam Sep 9, 2025
afbd3a7
updated suggestion
SubhikshaSf4851 Apr 28, 2026
6fc105a
updates iOS snapshot
SubhikshaSf4851 Jun 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue31065.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 31065, "IndicatorView square shape does not update on load or dynamically", PlatformAffected.iOS | PlatformAffected.macOS)]
public class Issue31065 : ContentPage
{
IndicatorView _indicator;
public Issue31065()
{
var carousel = new CarouselView
{
ItemsSource = new[] { "Item 1", "Item 2", "Item 3" },
HeightRequest = 250,
};

_indicator = new IndicatorView
{
IndicatorsShape = IndicatorShape.Square,
SelectedIndicatorColor = Colors.Blue,
IndicatorSize = 30
};

Button button = new Button
{
Text = "Change indicator shape",
HorizontalOptions = LayoutOptions.Center,
AutomationId = "ChangeIndicatorShapeButton",
Margin = new Thickness(0, 20, 0, 0)
};

button.Command = new Command(() =>
{
if (_indicator.IndicatorsShape == IndicatorShape.Square)
{
_indicator.IndicatorsShape = IndicatorShape.Circle;
}
else
{
_indicator.IndicatorsShape = IndicatorShape.Square;
}
});

carousel.IndicatorView = _indicator;

Content = new VerticalStackLayout
{
Children =
{
carousel,
_indicator,
button
}
};
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue31065 : _IssuesUITest
{
public override string Issue => "IndicatorView square shape does not update on load or dynamically";

public Issue31065(TestDevice device) : base(device)
{ }

[Test, Order(0)]
[Category(UITestCategories.IndicatorView)]
public void UpdateIndicatorViewSquareShape()
{
App.WaitForElement("ChangeIndicatorShapeButton");
VerifyScreenshot("IndicatorViewSquareShape");
}

[Test, Order(1)]
[Category(UITestCategories.IndicatorView)]
public void UpdateIndicatorViewCircleShape()
{
App.Tap("ChangeIndicatorShapeButton");
VerifyScreenshot("IndicatorViewCircleShape");
}

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 33 additions & 19 deletions src/Core/src/Platform/iOS/MauiPageControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public class MauiPageControl : UIPageControl, IUIViewLifeCycleEvents
{
const int DefaultIndicatorSize = 6;
const double IndicatorSizeTolerance = 0.001;

const string SquareSymbol = "squareshape.fill";
Comment thread
Tamilarasan-Paranthaman marked this conversation as resolved.
const string CircleSymbol = "circlebadge.fill";
WeakReference<IIndicatorView>? _indicatorView;
bool _updatingPosition;
double _lastAppliedIndicatorSize = -1;
Expand Down Expand Up @@ -56,11 +57,10 @@ public override void LayoutSubviews()
return;

UpdateIndicatorSize();

if (!IsSquare)
return;

UpdateSquareShape();
if (_indicatorView?.TryGetTarget(out var indicatorView) == true && (indicatorView as ITemplatedIndicatorView)?.IndicatorsLayoutOverride == null)
{
UpdateIndicatorShape();
}
}

public void UpdateIndicatorSize()
Expand Down Expand Up @@ -107,9 +107,9 @@ public void UpdateIndicatorCount()
UpdatePosition();
}

void UpdateSquareShape()
void UpdateIndicatorShape()
{
if (!(OperatingSystem.IsIOSVersionAtLeast(14) || OperatingSystem.IsTvOSVersionAtLeast(14)))
if (!(OperatingSystem.IsIOSVersionAtLeast(14) || OperatingSystem.IsTvOSVersionAtLeast(14) || OperatingSystem.IsMacCatalystVersionAtLeast(14)))
{
UpdateCornerRadius();
return;
Expand All @@ -118,20 +118,34 @@ void UpdateSquareShape()
var uiPageControlContentView = Subviews[0];
if (uiPageControlContentView.Subviews.Length > 0)
{
var uiPageControlIndicatorContentView = uiPageControlContentView.Subviews[0];
foreach (var uiPageControlIndicatorContentView in uiPageControlContentView.Subviews)
{
SetIndicatorShape(uiPageControlIndicatorContentView, IsSquare);
}
}
}

foreach (var view in uiPageControlIndicatorContentView.Subviews)
// Recursively find UIImageView and set its image
static void SetIndicatorShape(UIView view, bool isSquare)
{
if (view is UIImageView imageView)
{
if (OperatingSystem.IsIOSVersionAtLeast(13) || OperatingSystem.IsTvOSVersionAtLeast(13) || OperatingSystem.IsMacCatalystVersionAtLeast(13))
{
if (view is UIImageView imageview)
{
if (OperatingSystem.IsIOSVersionAtLeast(13) || OperatingSystem.IsTvOSVersionAtLeast(13))
imageview.Image = UIImage.GetSystemImage("squareshape.fill");
var frame = imageview.Frame;
//the square shape is not the same size as the circle so we might need to correct the frame
imageview.Frame = new CGRect(frame.X - 6, frame.Y, frame.Width, frame.Height);
Comment thread
Tamilarasan-Paranthaman marked this conversation as resolved.
}
imageView.Image = UIImage.GetSystemImage(isSquare ? SquareSymbol : CircleSymbol);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[major] iOS/MacCatalyst Platform — This now replaces every non-templated circle IndicatorView's native UIPageControl dot with the SF Symbol circlebadge.fill whenever layout runs, not just when recovering from a square shape. That changes existing circle indicator rendering on iOS/MacCatalyst and relies on private UIPageControl subviews being UIImageViews. Since iOS 14+ exposes public indicator-image APIs, prefer using PreferredIndicatorImage/SetIndicatorImage and clear the custom image for Circle so native circle rendering is preserved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The recommended change causes a loop when updating the indicator shape dynamically.

return;
}
}

if (view.Subviews is null || view.Subviews.Length == 0)
{
return;
}

foreach (var child in view.Subviews)
Comment thread
Tamilarasan-Paranthaman marked this conversation as resolved.
{
SetIndicatorShape(child, isSquare);
}
}

void UpdateCornerRadius()
Expand All @@ -150,7 +164,7 @@ void MauiPageControlValueChanged(object? sender, System.EventArgs e)
indicatorView.Position = (int)CurrentPage;
//if we are iOS13 or lower and we are using a Square shape
//we need to update the CornerRadius of the new shape.
if (IsSquare && !(OperatingSystem.IsIOSVersionAtLeast(14) || OperatingSystem.IsTvOSVersionAtLeast(14)))
if (IsSquare && !(OperatingSystem.IsIOSVersionAtLeast(14) || OperatingSystem.IsTvOSVersionAtLeast(14) || OperatingSystem.IsMacCatalystVersionAtLeast(14)))
LayoutSubviews();

}
Expand Down
Loading