maui
maui copied to clipboard
[regression/7.0.92] IndicatorView not visible on iOS
Description
Works on Android, but nothing on iOS. Have tried multiple projects, and different layouts.
I confirmed this in 8.0.0 RC2 and 7.0.92.
Steps to Reproduce
Run the sample on iOS 17 or 16.4, simulator or device.
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:viewmodels="clr-namespace:CarouselViewDemos.ViewModels"
x:Class="CarouselViewDemos.Views.HorizontalLayoutWithIndicatorsPage"
Title="Indicators">
<ContentPage.BindingContext>
<viewmodels:MonkeysViewModel />
</ContentPage.BindingContext>
<StackLayout>
<CarouselView ItemsSource="{Binding Monkeys}"
IndicatorView="indicatorView">
<CarouselView.ItemTemplate>
<DataTemplate>
<StackLayout>
<Frame HasShadow="True"
BorderColor="DarkGray"
CornerRadius="5"
Margin="20"
HeightRequest="300"
HorizontalOptions="Center"
VerticalOptions="Center">
<StackLayout>
<Label Text="{Binding Name}"
FontAttributes="Bold"
FontSize="20"
HorizontalOptions="Center"
VerticalOptions="Center" />
<Image Source="{Binding ImageUrl}"
Aspect="AspectFill"
HeightRequest="150"
WidthRequest="150"
HorizontalOptions="Center" />
<Label Text="{Binding Location}"
HorizontalOptions="Center" />
<Label Text="{Binding Details}"
FontAttributes="Italic"
HorizontalOptions="Center"
MaxLines="5"
LineBreakMode="TailTruncation" />
</StackLayout>
</Frame>
</StackLayout>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
<IndicatorView x:Name="indicatorView"
IndicatorsShape="Square"
IndicatorColor="LightGray"
SelectedIndicatorColor="DarkGray"
HorizontalOptions="Center"
Margin="0,0,0,40" />
</StackLayout>
</ContentPage>
Link to public reproduction project repository
https://github.com/dotnet/maui-samples/tree/main/7.0/UserInterface/Views/CarouselViewDemos
Version with bug
7.0.92
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
iOS, macOS
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
just to add a note, there is a difference between rendering on Android and iOS but we have the indicator view working here and it seems like (at least in our project) a set height request on the CarouselView tag makes the indicator view appear.
Try setting HeightRequest="200" in your example above between lines 11 & 12
just to add a note, there is a difference between rendering on Android and iOS but we have the indicator view working here and it seems like (at least in our project) a set height request on the CarouselView tag makes the indicator view appear.
Try setting HeightRequest="200" in your example above between lines 11 & 12
Have done a quick test with main branch with a similar result. Required to set the HeightRequest property to the CarouselView.
Verified this on Visual Studio Enterprise 17.9.0 Preview 1(8.0.3). Repro on iOS 17.0 and MacCatalyst, not repro on Windows 11 and Android 14.0-API34 with below Project: CarouselViewDemos.zip
even from the .net maui samples project of official .net maui, this issue can be reproduced
It seems to be working fine on the latest main branch
https://github.com/user-attachments/assets/0908fd9d-cb10-455f-a149-335bd3e388b2
Hi @davidortinau. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.
You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Thanks for checking this. I added a note to try updating maui.