Xamarin.forms: [Bug] CarouselView does not work on Contentview with iOS version

Created on 18 Feb 2020  路  20Comments  路  Source: xamarin/Xamarin.Forms

Description

Currently, I'm developing an application worked on Tablet. For example, there are top menu (with 4 buttons) and ONE content view and Side menu (it's a list view). Layout in content view will be changed after I click on any button or item in list view.

For top menu, there are 2 buttons to feature for scanning. The photo will be displayed on the content view with carousel view control after taking the photo.

Steps to Reproduce

  1. In the top menu, Taking 3 photos in button 1 and 2 photos for button 2.
  2. Next step, Click on button 1, the images are shown in Carousel view and Position is 1 (it means we'are seeing the second photo)
  3. Then, I switch to button 2 to view some photos which we took before
  4. App crash --> Show error in log: Cannot access a disposed object. Object name: 'CarouselViewController'

Expected Behavior

The app should be not crash

Actual Behavior

Basic Information

  • Version with issue: Xamarin.Forms v4.4.0.991640
carouselview contentview 2 high impact iOS 馃崕 bug

Most helpful comment

I got the same crash. XF 4.5.0.356

All 20 comments

@quanvm97 Can you please attach a small project that demonstrates this issue? Thanks!

@quanvm97 whenever you reply to a github email the reply goes onto the public ticket. I deleted your comment to remove whatever info you might not want public

Can you you try with the latest nightly
https://github.com/xamarin/Xamarin.Forms/wiki/Nightly-Builds

or try reproducing the exception in a smaller project and attach it for us to look at?

@quanvm97 whenever you reply to a github email the reply goes onto the public ticket. I deleted your comment to remove whatever info you might not want public

Can you you try with the latest nightly
https://github.com/xamarin/Xamarin.Forms/wiki/Nightly-Builds

or try reproducing the exception in a smaller project and attach it for us to look at?

I just installed latest version Xamarin Forms in Nightly (v4.6), but the problem has not solved yet.

@quanvm97 Could you attach a repro sample?. If it is not possible, to know well the UI hierarchy and try to replicate it, could you give more details of the use of CarouselView (where it is used, etc.)?

Could you please install Fairflexx Capture (latest version) to check it on App Store? (By open "New with card" and testing. Currently, I'm using Carousel View Plugin in iOS

This is main layout.

 <Grid RowSpacing="0"
              ColumnSpacing="0"
              BackgroundColor="White">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <!--Top menu-->
            <Grid x:Name="gridTopMenu" 
                  BackgroundColor="LightGray"
                  ColumnSpacing="0"
                  RowSpacing="0" 
                  Grid.Row="0" 
                  Grid.Column="0" 
                  HeightRequest="{DynamicResource HeightHeader}"
                  Padding="0,5"
                  HorizontalOptions="FillAndExpand"
                  IsVisible="{Binding IsShownTopMenu}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="50"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="50"/>
                </Grid.ColumnDefinitions>
                <!-- Here are buttons -->
            </Grid>

            <!--Header title-->
            <StackLayout BackgroundColor="White"
                         Grid.Row="1"
                         Grid.Column="0"
                         x:Name="stTitle"
                         Orientation="Horizontal"
                         HorizontalOptions="FillAndExpand"
                         Padding="15,0,5,0"
                         HeightRequest="65"
                         IsVisible="{Binding IsShownTopMenu}">
                <Label Text="{Binding Title}"
                       FontSize="{DynamicResource HugeLabelFont}"
                       FontAttributes="Bold"
                       HorizontalOptions="StartAndExpand"
                       VerticalOptions="CenterAndExpand"/>
            </StackLayout>

            <Grid Grid.Row="2"
                  Padding="0,10,0,0"
                  ColumnSpacing="0"
                  RowSpacing="0"
                  HorizontalOptions="FillAndExpand"
                  VerticalOptions="FillAndExpand">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <!--Content page-->
                <ScrollView x:Name="svContentPage"
                            Grid.Column="0"
                            HorizontalOptions="FillAndExpand"
                            VerticalOptions="FillAndExpand"
                            BackgroundColor="White"
                            Padding="25,0,15,0"
                            Margin="0,0,5,0"/>

                <!--Side menu-->
                <StackLayout Grid.Column="1"
                             x:Name="sideMenu"
                             BackgroundColor="Transparent"
                             VerticalOptions="StartAndExpand"
                             WidthRequest="150"
                             Margin="0,0,5,0">
                    <!-- Here is stacklayout contain some other controls
                    <!--IsVisible="{Binding IsVisibleSideMenu}">-->
                    <ListView x:Name="SideMenuListView" HasUnevenRows="true"
                              SeparatorColor="DimGray"
                              ItemsSource="{Binding DataSideMenu}"
                              SelectedItem="{Binding Selected, Mode=TwoWay}"
                              ItemTapped="MenuItemsTapped"
                              ItemSelected="MenuItemsSelected"
                              BackgroundColor="White">
                        <ListView.ItemTemplate>
                            <DataTemplate>
                                <ViewCell>
                                ......
                                </ViewCell>
                            </DataTemplate>
                        </ListView.ItemTemplate>
                    </ListView>
                </StackLayout>

            </Grid>

        </Grid>

Content of ScrollView will be change in code behind by a view returned from ViewModel:

var vm = (NewLeadTemplatePageViewModel)BindingContext;
svContentPage.Content = await vm?.TopMenuItemSelectedExecute(isSelected: background);

And this is contentview after I tap on a button on top menu

<ContentView.Content>
        <StackLayout BackgroundColor="White"
                     x:Name="attachView"
                     Padding="8,0">

            <StackLayout Orientation="Horizontal"
                         HorizontalOptions="FillAndExpand"
                         Spacing="0">
                <Label Text="{localization:Translate Attachment}"
                       FontAttributes="Bold"
                       FontSize="{DynamicResource LargeLabelFont}"/>
                <controls:ImageButton Source="ic_cancel"
                                      WidthRequest="20"
                                      HeightRequest="20"
                                      Command="{Binding DeleteCommand}"
                                      HorizontalOptions="EndAndExpand"
                                      VerticalOptions="CenterAndExpand"
                                      IsVisible="{Binding LeadTypeFiles, Converter={StaticResource AnyScannerResultItemsToBoolConverter}}"/>
            </StackLayout>
            <Grid HorizontalOptions="FillAndExpand"
                  HeightRequest="375"
                  BackgroundColor="DimGray"
                  Padding="1"
                  Margin="0,0,0,20">
                <Grid HorizontalOptions="FillAndExpand"
                      VerticalOptions="FillAndExpand"
                      BackgroundColor="White">
                    <StackLayout VerticalOptions="CenterAndExpand"
                                 HorizontalOptions="CenterAndExpand">
                        <controls:ImageButton Source="btn_Plus"
                                              Style="{DynamicResource ImageButtonSize}"
                                              Command="{Binding ScanCommand}"
                                              CommandParameter="Attachment"/>
                        <Label Text="{localization:Translate NewAttachment}"
                               HorizontalOptions="CenterAndExpand"
                               FontSize="{DynamicResource NormalLabelFont}"
                               FontAttributes="Bold"/>
                    </StackLayout>
                </Grid>
                <Grid HorizontalOptions="FillAndExpand"
                      IsVisible="{Binding LeadTypeFiles, Converter={StaticResource AnyScannerResultItemsToBoolConverter}}"
                      BackgroundColor="White">
                            <CarouselView x:Name="carouselViewControl"
                                                      IsSwipeEnabled="False"
                                                          Position="{Binding Position}"
                                                          ItemsSource="{Binding ScannerResult}" 
                                                          VerticalOptions="FillAndExpand" 
                                                          HorizontalOptions="FillAndExpand"
                                                          Margin="5">
                                <CarouselView.ItemTemplate>
                                    <DataTemplate>
                                        <Grid VerticalOptions="FillAndExpand"
                                          HorizontalOptions="FillAndExpand">
                                            <Grid.GestureRecognizers>
                                                <TapGestureRecognizer Command="{Binding Path=BindingContext.ZoomImageCommand, 
                                                                    Source={x:Reference Name=carouselViewControl}}"
                                                              CommandParameter="{Binding}"/>
                                            </Grid.GestureRecognizers>
                                            <forms:CachedImage CacheType="None"
                                                               Aspect="AspectFit"
                                                               Source="{Binding ByteImage, Mode=TwoWay, Converter={StaticResource ImageByteResourceConverter}}"/>
                                            <!--Source="{Binding Source}" />-->
                                        </Grid>
                                    </DataTemplate>
                                </CarouselView.ItemTemplate>
                            </CarouselView>
                    <controls:ImageButton Source="ic_left_arrow"
                                              IsVisible="{Binding IsVisibleBack}"
                                              Command="{Binding BackImageCommand}"
                                              BackgroundColor="Transparent"
                                              HorizontalOptions="Start"
                                              VerticalOptions="Center"
                                      WidthRequest="35"
                                      HeightRequest="35"/>
                    <controls:ImageButton Source="ic_right_arrow"
                                              IsVisible="{Binding IsVisibleNext}"
                                              Command="{Binding NextImageCommand}"
                                              BackgroundColor="Transparent"
                                              VerticalOptions="Center"
                                              HorizontalOptions="End"
                                      WidthRequest="35"
                                      HeightRequest="35"/>
                </Grid>

            </Grid>
        </StackLayout>

    </ContentView.Content>

This is main layout.

 <Grid RowSpacing="0"
              ColumnSpacing="0"
              BackgroundColor="White">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <!--Top menu-->
            <Grid x:Name="gridTopMenu" 
                  BackgroundColor="LightGray"
                  ColumnSpacing="0"
                  RowSpacing="0" 
                  Grid.Row="0" 
                  Grid.Column="0" 
                  HeightRequest="{DynamicResource HeightHeader}"
                  Padding="0,5"
                  HorizontalOptions="FillAndExpand"
                  IsVisible="{Binding IsShownTopMenu}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="50"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="50"/>
                </Grid.ColumnDefinitions>
                <!-- Here are buttons -->
            </Grid>

            <!--Header title-->
            <StackLayout BackgroundColor="White"
                         Grid.Row="1"
                         Grid.Column="0"
                         x:Name="stTitle"
                         Orientation="Horizontal"
                         HorizontalOptions="FillAndExpand"
                         Padding="15,0,5,0"
                         HeightRequest="65"
                         IsVisible="{Binding IsShownTopMenu}">
                <Label Text="{Binding Title}"
                       FontSize="{DynamicResource HugeLabelFont}"
                       FontAttributes="Bold"
                       HorizontalOptions="StartAndExpand"
                       VerticalOptions="CenterAndExpand"/>
            </StackLayout>

            <Grid Grid.Row="2"
                  Padding="0,10,0,0"
                  ColumnSpacing="0"
                  RowSpacing="0"
                  HorizontalOptions="FillAndExpand"
                  VerticalOptions="FillAndExpand">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <!--Content page-->
                <ScrollView x:Name="svContentPage"
                            Grid.Column="0"
                            HorizontalOptions="FillAndExpand"
                            VerticalOptions="FillAndExpand"
                            BackgroundColor="White"
                            Padding="25,0,15,0"
                            Margin="0,0,5,0"/>

                <!--Side menu-->
                <StackLayout Grid.Column="1"
                             x:Name="sideMenu"
                             BackgroundColor="Transparent"
                             VerticalOptions="StartAndExpand"
                             WidthRequest="150"
                             Margin="0,0,5,0">
                    <!-- Here is stacklayout contain some other controls
                    <!--IsVisible="{Binding IsVisibleSideMenu}">-->
                    <ListView x:Name="SideMenuListView" HasUnevenRows="true"
                              SeparatorColor="DimGray"
                              ItemsSource="{Binding DataSideMenu}"
                              SelectedItem="{Binding Selected, Mode=TwoWay}"
                              ItemTapped="MenuItemsTapped"
                              ItemSelected="MenuItemsSelected"
                              BackgroundColor="White">
                        <ListView.ItemTemplate>
                            <DataTemplate>
                                <ViewCell>
                              ......
                                </ViewCell>
                            </DataTemplate>
                        </ListView.ItemTemplate>
                    </ListView>
                </StackLayout>

            </Grid>

        </Grid>

Content of ScrollView will be change in code behind by a view returned from ViewModel:

var vm = (NewLeadTemplatePageViewModel)BindingContext;
svContentPage.Content = await vm?.TopMenuItemSelectedExecute(isSelected: background);

And this is contentview after I tap on a button on top menu

<ContentView.Content>
        <StackLayout BackgroundColor="White"
                     x:Name="attachView"
                     Padding="8,0">

            <StackLayout Orientation="Horizontal"
                         HorizontalOptions="FillAndExpand"
                         Spacing="0">
                <Label Text="{localization:Translate Attachment}"
                       FontAttributes="Bold"
                       FontSize="{DynamicResource LargeLabelFont}"/>
                <controls:ImageButton Source="ic_cancel"
                                      WidthRequest="20"
                                      HeightRequest="20"
                                      Command="{Binding DeleteCommand}"
                                      HorizontalOptions="EndAndExpand"
                                      VerticalOptions="CenterAndExpand"
                                      IsVisible="{Binding LeadTypeFiles, Converter={StaticResource AnyScannerResultItemsToBoolConverter}}"/>
            </StackLayout>
            <Grid HorizontalOptions="FillAndExpand"
                  HeightRequest="375"
                  BackgroundColor="DimGray"
                  Padding="1"
                  Margin="0,0,0,20">
                <Grid HorizontalOptions="FillAndExpand"
                      VerticalOptions="FillAndExpand"
                      BackgroundColor="White">
                    <StackLayout VerticalOptions="CenterAndExpand"
                                 HorizontalOptions="CenterAndExpand">
                        <controls:ImageButton Source="btn_Plus"
                                              Style="{DynamicResource ImageButtonSize}"
                                              Command="{Binding ScanCommand}"
                                              CommandParameter="Attachment"/>
                        <Label Text="{localization:Translate NewAttachment}"
                               HorizontalOptions="CenterAndExpand"
                               FontSize="{DynamicResource NormalLabelFont}"
                               FontAttributes="Bold"/>
                    </StackLayout>
                </Grid>
                <Grid HorizontalOptions="FillAndExpand"
                      IsVisible="{Binding LeadTypeFiles, Converter={StaticResource AnyScannerResultItemsToBoolConverter}}"
                      BackgroundColor="White">
                            <CarouselView x:Name="carouselViewControl"
                                                      IsSwipeEnabled="False"
                                                          Position="{Binding Position}"
                                                          ItemsSource="{Binding ScannerResult}" 
                                                          VerticalOptions="FillAndExpand" 
                                                          HorizontalOptions="FillAndExpand"
                                                          Margin="5">
                                <CarouselView.ItemTemplate>
                                    <DataTemplate>
                                        <Grid VerticalOptions="FillAndExpand"
                                          HorizontalOptions="FillAndExpand">
                                            <Grid.GestureRecognizers>
                                                <TapGestureRecognizer Command="{Binding Path=BindingContext.ZoomImageCommand, 
                                                                    Source={x:Reference Name=carouselViewControl}}"
                                                              CommandParameter="{Binding}"/>
                                            </Grid.GestureRecognizers>
                                            <forms:CachedImage CacheType="None"
                                                               Aspect="AspectFit"
                                                               Source="{Binding ByteImage, Mode=TwoWay, Converter={StaticResource ImageByteResourceConverter}}"/>
                                            <!--Source="{Binding Source}" />-->
                                        </Grid>
                                    </DataTemplate>
                                </CarouselView.ItemTemplate>
                            </CarouselView>
                    <controls:ImageButton Source="ic_left_arrow"
                                              IsVisible="{Binding IsVisibleBack}"
                                              Command="{Binding BackImageCommand}"
                                              BackgroundColor="Transparent"
                                              HorizontalOptions="Start"
                                              VerticalOptions="Center"
                                      WidthRequest="35"
                                      HeightRequest="35"/>
                    <controls:ImageButton Source="ic_right_arrow"
                                              IsVisible="{Binding IsVisibleNext}"
                                              Command="{Binding NextImageCommand}"
                                              BackgroundColor="Transparent"
                                              VerticalOptions="Center"
                                              HorizontalOptions="End"
                                      WidthRequest="35"
                                      HeightRequest="35"/>
                </Grid>

            </Grid>
        </StackLayout>

    </ContentView.Content>

There are 5 button in Top menu. The 4th and 5th button, I will return a view which is written in ContentView with CarouselView by the following code:

var vm = (NewLeadTemplatePageViewModel)BindingContext;
svContentPage.Content = await vm?.TopMenuItemSelectedExecute(isSelected: background);

I got the same crash. XF 4.5.0.356

@IgorStrekha it would be really helpful if you would be able to add a reproduction that shows this bug

@jfversluis I have created the sample.

Steps:
Launch the App.
Open Side menu (swipe to the right)
Open ActivityPage
Play with Tabs and swipe carousel views.
Open Side menu again
Open HomePage
Open Side menu again
Open ActivityPage
Tap on Pending tab.
The App is crashed.

video: https://drive.google.com/file/d/11BQEKlnbroeyceJwc0ncnV5FBd5emm8B/view?usp=sharing
sample:
Bug.zip

Looking forward when the issue will be fixed. Thank you.

Copying this from my previous issue as it was a duplicate of this one.

Description

I have a CarouselView in an AppShell on the home page. It is not the main view on the page but just a section of the page. If I swipe through the CarouselView and then switch to a different screen in the hamburger menu and then go back and try to swipe through. The app crashes

Steps to Reproduce

  1. Load AppShell home page with CarouselView on the page
  2. Swipe through CarouselView
  3. Open side menu and select different page
  4. Open side menu and go back to home page
  5. Try to swipe CarouselView (app crashes

Expected Behavior

Able to swipe through CarouselView after switching to a different page

Actual Behavior

App crashes

Basic Information

  • Version with issue: 4.5.0.356
  • Last known good version: N/A
  • IDE: Visual Studio for Mac
  • Platform Target Frameworks:

    • iOS: 8.0

  • Nuget Packages:
  • Affected Devices: iOS

Screenshots

N/A

Reproduction Link

Workaround

Not yet.

Stacktrace

at Foundation.NSObject.get_SuperHandle () [0x00012] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.10.0.21/src/Xamarin.iOS/Foundation/NSObject2.cs:449 at UIKit.UICollectionViewController.get_CollectionView () [0x0002a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.10.0.21/src/Xamarin.iOS/UICollectionViewController.g.cs:1101 at Xamarin.Forms.Platform.iOS.CarouselViewController.UpdateVisualStates () [0x00000] in d:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\CarouselViewController.cs:133 at Xamarin.Forms.Platform.iOS.CarouselViewController.CarouselViewScrolled (System.Object sender, Xamarin.Forms.ItemsViewScrolledEventArgs e) [0x00000] in d:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\CarouselViewController.cs:26 at (wrapper delegate-invoke) System.EventHandler`1[Xamarin.Forms.ItemsViewScrolledEventArgs].invoke_void_object_TEventArgs(object,Xamarin.Forms.ItemsViewScrolledEventArgs) at Xamarin.Forms.ItemsView.SendScrolled (Xamarin.Forms.ItemsViewScrolledEventArgs e) [0x00000] in d:\a\1\s\Xamarin.Forms.Core\Items\ItemsView.cs:186 at Xamarin.Forms.Platform.iOS.ItemsViewDelegator`2[TItemsView,TViewController].Scrolled (UIKit.UIScrollView scrollView) [0x001b7] in d:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\ItemsViewDelegator.cs:55 at Xamarin.Forms.Platform.iOS.CarouselViewDelegator.Scrolled (UIKit.UIScrollView scrollView) [0x00000] in d:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\CarouselViewDelegator.cs:14 at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr) at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.10.0.21/src/Xamarin.iOS/UIKit/UIApplication.cs:86 at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.10.0.21/src/Xamarin.iOS/UIKit/UIApplication.cs:65 at Mobile.BlueKCMember.iOS.Application.Main (System.String[] args) [0x00001] in /Users/keisenb/git/project/src/project.iOS/Main.cs:17

I have the same problem. I can confirm if necessary.
(problem only on ios, i use last stable xamarin version. Using observablecollection for itemsource, carouselview writen on xaml).
Also trying last nightly - exception keep

Confirmed that this is happening with the attached repro from this comment. Also tried the latest 4.5 stable and 4.7 nightly, but doesn't resolve this. Seems to be (somewhat) related to #9676 and #8785

Full stacktrace:

Unhandled Exception:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'CarouselViewController'.
at Foundation.NSObject.get_SuperHandle () [0x00012] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.14.1.39/src/Xamarin.iOS/Foundation/NSObject2.cs:449
at UIKit.UICollectionViewController.get_CollectionView () [0x0002a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.14.1.39/src/Xamarin.iOS/UICollectionViewController.g.cs:1101
at Xamarin.Forms.Platform.iOS.CarouselViewController.UpdateVisualStates () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\CarouselViewController.cs:139
at Xamarin.Forms.Platform.iOS.CarouselViewController.CarouselViewScrolled (System.Object sender, Xamarin.Forms.ItemsViewScrolledEventArgs e) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\CarouselViewController.cs:26
at (wrapper delegate-invoke) System.EventHandler1[Xamarin.Forms.ItemsViewScrolledEventArgs].invoke_void_object_TEventArgs(object,Xamarin.Forms.ItemsViewScrolledEventArgs) at Xamarin.Forms.ItemsView.SendScrolled (Xamarin.Forms.ItemsViewScrolledEventArgs e) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Items\ItemsView.cs:186 at Xamarin.Forms.Platform.iOS.ItemsViewDelegator2[TItemsView,TViewController].Scrolled (UIKit.UIScrollView scrollView) [0x001b7] in D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\ItemsViewDelegator.cs:55
at Xamarin.Forms.Platform.iOS.CarouselViewDelegator.Scrolled (UIKit.UIScrollView scrollView) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\CarouselViewDelegator.cs:14
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.14.1.39/src/Xamarin.iOS/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.14.1.39/src/Xamarin.iOS/UIKit/UIApplication.cs:65
at Bug.iOS.Application.Main (System.String[] args) [0x00001] in /Users/jfversluis/Downloads/Bug/Bug.iOS/Main.cs:17
2020-03-20 16:07:36.216214+0100 Bug.iOS[43050:1127407] Unhandled managed exception: Cannot access a disposed object.
Object name: 'CarouselViewController'. (System.ObjectDisposedException)
at Foundation.NSObject.get_SuperHandle () [0x00012] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.14.1.39/src/Xamarin.iOS/Foundation/NSObject2.cs:449
at UIKit.UICollectionViewController.get_CollectionView () [0x0002a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.14.1.39/src/Xamarin.iOS/UICollectionViewController.g.cs:1101
at Xamarin.Forms.Platform.iOS.CarouselViewController.UpdateVisualStates () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\CarouselViewController.cs:139
at Xamarin.Forms.Platform.iOS.CarouselViewController.CarouselViewScrolled (System.Object sender, Xamarin.Forms.ItemsViewScrolledEventArgs e) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\CarouselViewController.cs:26
at (wrapper delegate-invoke) System.EventHandler1[Xamarin.Forms.ItemsViewScrolledEventArgs].invoke_void_object_TEventArgs(object,Xamarin.Forms.ItemsViewScrolledEventArgs) at Xamarin.Forms.ItemsView.SendScrolled (Xamarin.Forms.ItemsViewScrolledEventArgs e) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Items\ItemsView.cs:186 at Xamarin.Forms.Platform.iOS.ItemsViewDelegator2[TItemsView,TViewController].Scrolled (UIKit.UIScrollView scrollView) [0x001b7] in D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\ItemsViewDelegator.cs:55
at Xamarin.Forms.Platform.iOS.CarouselViewDelegator.Scrolled (UIKit.UIScrollView scrollView) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\CarouselViewDelegator.cs:14
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.14.1.39/src/Xamarin.iOS/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.14.1.39/src/Xamarin.iOS/UIKit/UIApplication.cs:65
at Bug.iOS.Application.Main (System.String[] args) [0x00001] in /Users/jfversluis/Downloads/Bug/Bug.iOS/Main.cs:17

any news?

Does anyone have any workarounds for this?

Does anyone have any workarounds for this?

Does anyone have any workarounds for this?

Hello everyone!!

Does anyone have any workarounds for this?

Thanks.

I'm not seeing this problem anymore with Xamarin.Forms 4.6.0.772. I'm not exactly sure when the problem went away, but I'm guessing it's related to a recent Forms release.

Tested with Xamarin.Forms 4.6.0.967 and the issue seems to be fixed.

Was this page helpful?
0 / 5 - 0 ratings