Xamarin.forms: [Bug][iOS] IndicatorView not visible when ItemSource of Carousel is set delayed (INotifyPropertyChanged)

Created on 21 Feb 2020  路  5Comments  路  Source: xamarin/Xamarin.Forms

Description

IndicatorView not visible when ItemSource of Carousel is set delayed (INotifyPropertyChanged)

Steps to Reproduce

  1. Bind ItemSource Property of Carousel
  2. Fill the binded collection and make sure that OnPropertyChanged is needed (delay initialisation).

Expected Behavior

IndicatorView is visible

Actual Behavior

IndicatorView is not visible

Basic Information

Version with issue: Xamarin.Forms 4.4.0.991640
Last known good version: -
IDE: Visual Studio Community 2019 for Mac (Version 8.4.3 (build 12))
Platform Target Frameworks:
iOS: 10+
Android: It is working in Android

Screencast

CarouselIndicatorView

Reproduction Link

I used this sample

And made this change:

        public MonkeysViewModel()
        {
            source = new List<Monkey>();

            Task.Run(async () =>
            {
                await Task.Delay(200);
                CreateMonkeyCollection();
                OnPropertyChanged(nameof(Monkeys));
                CurrentItem = Monkeys.Skip(3).FirstOrDefault();
                OnPropertyChanged("CurrentItem");
                Position = 3;
                OnPropertyChanged("Position");
            });
        }

Workaround

Toggle visibility of Carousel

indicatorview in-progress iOS 馃崕 bug

Most helpful comment

I'm still experiencing this issue on iOS in 4.8.0.1451. Was it fixed?

All 5 comments

I'm still experiencing this issue on iOS in 4.8.0.1451. Was it fixed?

If i give background color and scalling, i can see the view but i still can't see any indicator pointers. I just see a block or background color. What is interesting is that this block partially work
Can someone please share a workaround if any?

I am using Xamarin forms 4.8.0.1534.

@vecalion and @ali-h2010 I was experiencing the same thing on iOS where I couldn't see the indicators. Setting the background color gave me the visibility to be able to fix it however. I set my VerticalOptions and HorizontalOptions to FillAndExpand and it now shows. You can set your HeightRequest and WidthRequest as well to something large just to see the indicators then edit from there. Here's what my view looks like, hope it helps:

<IndicatorView x:Name="imageIndicators" IndicatorSize="{OnPlatform Android='9', iOS='10'}" MaximumVisible="6" HideSingle="True" ItemsSource="{Binding Images}" IndicatorColor="LightGray" SelectedIndicatorColor="RoyalBlue" BackgroundColor="AliceBlue" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>

thanks @C0D3On3 that solved it for me too

thanks @C0D3On3 that solved it for me too

You're welcome. Glad it helped @rarelyleemallon !

Was this page helpful?
0 / 5 - 0 ratings