Xamarin.forms: [Bug] IndicatorView isn't rendering indicators

Created on 4 Sep 2020  路  4Comments  路  Source: xamarin/Xamarin.Forms

Description

I'm not seeing any indicators. Perhaps an iOS 14 related thing. I verified the IndicatorView is present.

Simulator Screen Shot - iPhone 11 Pro - 2020-09-04 at 15 51 00

<StackLayout Margin="15" Spacing="10">
            <Frame BackgroundColor="White"
                   Padding="10"
                   BorderColor="Black"
                   CornerRadius="0">
                <CarouselView x:Name="reiCV"
                              IndicatorView="indicatorView"
                              HeightRequest="160">
                    <CarouselView.ItemsSource>
                        <x:Array Type="{x:Type x:String}">
                            <x:String>h01.png</x:String>
                            <x:String>h02.png</x:String>
                            <x:String>h03.png</x:String>
                            <x:String>h04.png</x:String>
                        </x:Array>
                    </CarouselView.ItemsSource>
                    <CarouselView.ItemTemplate>
                        <DataTemplate>
                            <Image Source="{Binding .}"/>
                        </DataTemplate>
                    </CarouselView.ItemTemplate>
                </CarouselView>
            </Frame>

            <IndicatorView 
                IndicatorColor="LightGray"
                SelectedIndicatorColor="Black"
                IndicatorSize="10"
                HorizontalOptions="Center"
                x:Name="indicatorView"/>

        </StackLayout>

Basic Information

  • Version with issue: 5.0.0.4865 (build from latest valid commit on that branch)
  • Platform Target Frameworks:

    • iOS: iOS 14 using preview 2 of Xamarin.iOS

Reproduction Link

https://github.com/davidortinau/CarouselGallery

Several examples use IndicatorView. None of them work properly.

indicatorview blocker 5 iOS 14 iOS 馃崕 bug

Most helpful comment

@PawKanarek I did have to tinker a little bit with (and on another screen again due to different layout), but this was working on a very simple layout:

<IndicatorView.IndicatorTemplate> <DataTemplate> <Frame HasShadow="False" Padding="3" HeightRequest="3" WidthRequest="3"> <Frame.CornerRadius> <OnPlatform x:TypeArguments="x:Single"> <On Platform="iOS" Value="5"></On> <On Platform="Android" Value="10"></On> </OnPlatform> </Frame.CornerRadius> </Frame> </DataTemplate> </IndicatorView.IndicatorTemplate>

I think it was adding some padding that helped.

All 4 comments

I was able to show custom indicators through IndicatorTemplate. Created a frame with rounded corners to mimic a round indicator.

@TiagoPicao-V23437 can you share your code with custom indicator template? I have the same issue with missing indicators iOS 14. And i've tied to make some custom template like you said, but my frame with rounded corners is as big as 40px, even if i said it height/width request should be 5px...

@PawKanarek I did have to tinker a little bit with (and on another screen again due to different layout), but this was working on a very simple layout:

<IndicatorView.IndicatorTemplate> <DataTemplate> <Frame HasShadow="False" Padding="3" HeightRequest="3" WidthRequest="3"> <Frame.CornerRadius> <OnPlatform x:TypeArguments="x:Single"> <On Platform="iOS" Value="5"></On> <On Platform="Android" Value="10"></On> </OnPlatform> </Frame.CornerRadius> </Frame> </DataTemplate> </IndicatorView.IndicatorTemplate>

I think it was adding some padding that helped.

Was this page helpful?
0 / 5 - 0 ratings