xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.63k stars 1.88k forks source link

[Bug] - XF 5 CarouselView PeekAreaInsets crashing #14311

Open Pandu-V opened 3 years ago

Pandu-V commented 3 years ago

Description

Steps to Reproduce

  1. We are using CarouselView with PeekAreaInsets
  2. When we remove PeekAreaInsets there is no crash, but we add PeekAreaInsets with any thickness its getting crashed .

Expected Behavior

CarouselView with PeekAreaInsets should work

Actual Behavior

Crashing while using PeekAreaInsets in CarouselView

Basic Information

Environment

Show/Hide Visual Studio info ``` ```

Build Logs

Screenshots

Reproduction Link

Workaround

rachelkang commented 3 years ago

Hi, @Pandu-V - thanks for submitting this issue. I tested with our CarouselView samples, and wasn't able to reproduce the issue. Which version of XF 5 exactly are you experiencing this on? And on which devices/platforms?

Pandu-V commented 3 years ago

Hi Team, I have this issue only on iOS[All phones] when we set PeakAreaInsets property in CarouselView for XF v5.0.0.2. Thanks, Pandu

rachelkang commented 3 years ago

Hi, @Pandu-V - would you be able to share a sample? I just tested again on an iOS device, with XF 5.0.0.2, but wasn't able to reproduce any issues

jsuarezruiz commented 3 years ago

Tried but cannot reproduce the issue. Could you attach a small sample? Issue14555.zip

DamienDoumer commented 2 years ago

I still have this bug in version 5.0.0.7775 of Xamarin Forms

AdamEssenmacher commented 2 years ago

Just hit this myself.

UIKitCore error message is: negative or zero item sizes are not supported in the flow layout

MonoTouchException: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: negative sizes are not supported in the flow layout.

In my case, I was experiencing this when PeekAreaInsets was set > 0 AND the view was also rotated around the Y-axis, which is common enough in animations.

softlion commented 2 years ago

Maybe linked to #15191

ac2112 commented 2 years ago

I'm having a similar problem with the CarouselView. If set PeekAreInsets I get the following failure: *** Assertion failure in -[Xamarin_Forms_Platform_iOS_CarouselViewLayout _getSizingInfosWithExistingSizingDictionary:], UICollectionViewFlowLayout.m:1501

bbenetskyy commented 2 years ago

@ac2112 Facing the same issue with iOS Simulators, fix from #15191 helps to solve as a temporary solution

grounch commented 1 year ago

@rachelkang facing the same issue with XF 5.0.0.2012 only on iOS. If i start the app and PeekAreInsets is defined (in xaml or code) the app crashes with the errors everyone mention above. If i start the app and i define PeekAreInsets in runtime, it seems to set it well with HotReload. However, with no surprise, if then i close the app and open it again: crash.

I tried to set it after page load without success. Not using the feature as @bbenetskyy suggests from this post isn't really a workaround but just closing your eyes on it.

I tried with the CarouselViewDemos sample and it's actually working fine. The only difference i see with my project is that i retrieve the content of the ObservableCollection from a server, and in the sample it's hardcoded.

It's really annoying as it's a nice UI feature and having it completely crashing the app was not expected.. Could you have a look at the issue? It seems to exist since a long time.

grounch commented 1 year ago

Looks like it's not gonna be handled anytime soon, used collectionview instead it looks similar...