AndreiMisiukevich / CardView

CardsView | CarouselView | CoverflowView | CubeView for Xamarin.Forms
MIT License
710 stars 114 forks source link

Carousel Item Wrongly showed other Section of Carousel While Swipe down on RefreshView #411

Closed UdayaDevConsole closed 2 years ago

UdayaDevConsole commented 2 years ago

Hi .. I am Uday Carousel View Working Fine on Both device i just Display the Section Based Content in Carousel inner of CollectionView When try to Refresh the Collection View it content wrongly showed other section of carousel view it updated Proper content after Few Second

UdayaDevConsole commented 2 years ago
UdayaDevConsole commented 2 years ago
AndreiMisiukevich commented 2 years ago

Hello Uday, unfortunately, I can't help you without a reproduction sample and video.

UdayaDevConsole commented 2 years ago

Hi @AndreiMisiukevich ... Here i Attached Reference Image . i showed Multiple Carousel in Single Page. It Properly Showed Under Section But Frame Content Wrongly Showed Other Section Content When i Refresh the Collection View After Few Second it Properly Showed.. The Issue Was Only on Xamarin IOS.. i also tried IsViewReusingEnabled="False" This is also Not Working For Ios

Expectation : Content Show Proper Under Section When We Refresh the View on CollectionView CarouselCacheRefreshIssue

UdayaDevConsole commented 2 years ago

@AndreiMisiukevich Also It Working Fine on Emulator and simulator But Issue on Deployment

AndreiMisiukevich commented 2 years ago

Hm, that's weird. If it works fine on iOS simulator then it should on real Device.

Can it be some Xamarin bug? Can you try to run the app on real device with linter disabled?

AndreiMisiukevich commented 2 years ago

Looks like collection view reorders items for a while. We don't control this process from collection view

UdayaDevConsole commented 2 years ago

so how to cache clear on collectionView

AndreiMisiukevich commented 2 years ago

I propose to fully recreate items source

UdayaDevConsole commented 2 years ago

Sorry .i couldn't understood . Can u explain briefly?

UdayaDevConsole commented 2 years ago

While Refresh the View What i do to ? i am Using Observable Collection for DataBinding CollView.ItemSource = RefreshData.ToList()

AndreiMisiukevich commented 2 years ago

What is inside RefreshData? Views or just items?

I mean, do you use ItemTemplate? Or add views directly to itemssource?

Also, you can try something so hacky.

Using code behind, remove your collection view from page and then add it again (on refresh). Or optionally recreate a new instance of collection view

UdayaDevConsole commented 2 years ago

i am using item Template and Data assign Using itemsource directly from c# Like below Mentioned XAML :

<StackLayout>
   <RefreshView>
      <CollectionView x:Name="CollView">
         <CollectionView.ItemTemplate>
           <DataTemplate>
               <cards:CarouselView>
                  <cards:CarouselView.ItemTemplate>
                    <DataTemplate>
                       <Frame/>
                    </DataTemplate>
                  </cards:CarouselView.ItemTemplate>
               </cards:CarouselView>
          </DataTemplate>
      </CollectionView.ItemTemplate>
   </CollectionView>
  </RefreshView>
</StackLayout>

C# : CollView.ItemSource = RefreshData.ToList()

UdayaDevConsole commented 2 years ago

@AndreiMisiukevich can u have sample for ",remove your collection view from page and then add it again (on refresh). Or optionally recreate a new instance of collection view" ?

UdayaDevConsole commented 2 years ago

Hi @AndreiMisiukevich i think its not collection view problem because Issue When i Scrolldown to bottom these way also occur same issue something wrong on carousel

AndreiMisiukevich commented 2 years ago

@UdayaDevConsole https://github.com/xamarin/Xamarin.Forms/issues/13045 it can be collectionview recycling issue Try to change collectionview to listview and set strategy to retain element instead recycling