Hello,
The CarouselView
is rendered by UICollectionView
in iOS platform, and UICollectionView
is derived from UIScrollView
. You can set showsHorizontalScrollIndicator
and showsVerticalScrollIndicator
false
to hide the indicator.
With MAUI, you could custom control with handlers and overwrite the ScrollToRequested
method, please refer to .NET MAUI control customization with handlers - .NET MAUI | Microsoft Learn and the following code:
CustomCarouseHandler.cs
namespace CarouselViewDemos.Handler
{
public partial class CustomCarouseHandler: Microsoft.Maui.Controls.Handlers.Items.CarouselViewHandler
{
}
}
CustomCarouseHandler.ios.cs
namespace CarouselViewDemos.Handler
{
public partial class CustomCarouseHandler
{
protected override void ScrollToRequested(object sender, ScrollToRequestEventArgs args)
{
Controller.CollectionView.ShowsHorizontalScrollIndicator = false;
Controller.CollectionView.ShowsVerticalScrollIndicator = false;
base.ScrollToRequested(sender, args);
}
}
}
Register the handler using the ConfigureMauiHandlers
and AddHandler
methods in your app's MauiProgram
class.
builder
.UseMauiApp<App>()
.ConfigureFonts...
.ConfigureMauiHandlers(handlers =>
{
handlers.AddHandler(typeof(CarouselView), typeof(CustomCarouseHandler));
});
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.