Cardview: It only works properly after I refresh the ItemsSource

Created on 9 May 2019  路  10Comments  路  Source: AndreiMisiukevich/CardView

I'm using VS 2019 for MAC, Xamarin.Forms 3.2.0.871581

I used this library in my project, and I saw that, It only works properly if I refresh the ItemsSource.
For the first time of loading, it still had the peek for previous Item even when I was displaying the first Item.

I setup as below
<cards:CoverFlowView IsViewCacheEnabled="false" HeightRequest="180" PositionShiftValue="70" IsCyclical="false" ItemsSource="{Binding Data.Value}">

  1. When it finished displaying on screen, I swipe left to see the 2nd item
    => it worked well
  2. I swipe right to see 1st item
    => It displayed peek for previous item

=> expected: it should not display peek for previous item. because the 1st item does have previous item.

  1. I click button refresh, to load data and binddata again. This time, it worked well.
question

All 10 comments

Hi,
Thanks for reporting

Why do you use IsViewCachingEnabled ?

Provide please sample. I will help to solve your case.

The reason why I set Value for IsViewCachingEnabled is that:
On my view, there is a Delete button, and if user click on it, the card would disappear. But afther that, when I refresh the ItemsSource, some items, it display white ( blank) and some Items it can display the view.

When I set sViewCachingEnabled="false", It worked well.

It sounds like the issue only appear on my project. I will try to reproduce this issue on an empty xamarin project.

@jerryno6 yeah)
It would be awesome, if you fork my repository, add code with issue, then send me branch name.
It will allow me to debug easily

https://github.com/jerryno6/CardView/tree/197
Here is the branch that I have folked and commited some changes.

It does not work well if I use Xamarin.Forms 3.2.0.871581
The peek layout on the left, it does not move, when User swipe.
=> Expected: The peek on the left/right should move, when user swipe left or right

After swiping left 1 time, then swipe right to see 1st item, The left peek still remains
=> Expected: While displaying first Item, It should remove the peek on the left

I also countered this error while running my project with CardView in debug mode.
VisualStudio disconnected from iOS Emulator & There were errors in the ApplicationOutput Windows

2019-05-09 16:45:35.988678+0700 Project.Mobile.iOS[54288:1110898] dynamic_cast error 2: One or more of the following type_info's has hidden visibility. They should all have public visibility. N10__cxxabiv116__shim_type_infoE, id, N10__cxxabiv117__pbase_type_infoE.
2019-05-09 16:45:35.988854+0700 Project.Mobile.iOS[54288:1110898] dynamic_cast error 2: One or more of the following type_info's has hidden visibility. They should all have public visibility. N10__cxxabiv116__shim_type_infoE, id, N10__cxxabiv117__pbase_type_infoE.
2019-05-09 16:45:35.989027+0700 Project.Mobile.iOS[54288:1110898] dynamic_cast error 2: One or more of the following type_info's has hidden visibility. They should all have public visibility. N10__cxxabiv116__shim_type_infoE, id, N10__cxxabiv117__pbase_type_infoE.

@jerryno6 i think, you needn't have to disable view caching
Could you please provide sample what's wrong with view caching?
Show me the error

Disabling view caching has no sense for CoverFlowView

The reason why I set Value for IsViewCachingEnabled is that:
On my view, there is a Delete button, and if user click on it, the card would disappear. But afther that, when I refresh the ItemsSource, some items, it display white ( blank) and some Items it can display the view.

When I set sViewCachingEnabled="false", It worked well.

It sounds like the issue only appear on my project. I will try to reproduce this issue on an empty xamarin project.

seems your problem can be solved by bindings easily.

So, show me initial issue and we will solve it without cache disabling

anyway: don't set IsViewCacheEnabled to false (it's important to keep true for coverFlowView)

removing items works fine, just tried on sample
So, if you want to get help, provide sample. I think, there is some bug in your code.

Yes, I will test it again, and provide you the simplest code, if I can reproduce it. Thanks for your support.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

toshitani23 picture toshitani23  路  6Comments

PauchardThomas picture PauchardThomas  路  7Comments

SkeletonJohn picture SkeletonJohn  路  3Comments

InquisitorJax picture InquisitorJax  路  6Comments

2092015 picture 2092015  路  5Comments