Closed dzebas closed 3 years ago
Hi, Weird, if you scroll left/right all is good, but if up/down the issue appears? I don't think I can do much w/out reproduction.
Maybe try to remove DesiredMaxChildrenCount="3"
That's not what you think, I guess)
Also, change ItemSwiped="CarouselView_ItemAppeared" to ItemAppeared
Hi Andrei,
Yes, it's a weird problem. It also happens with Xamarin CarouselView. For some reason when you first swipe up/down on page 1, then layout is triggered on page 2 even if not visible yet. If you swipe left then page 2 gets visible a little and then layout height is calculated correctly.
Changing DesiredMaxChildrenCount didn't fix it. I completely understand that it's very hard to reproduce without a demo, hopefully I've enough time at some point to produce one.
Love your CardView, it's fantastic! Greetings from Lithuania :)
@dzebas hm, if the same issue exists on XF carousel, then it's not a CardsView bug. That's more WebView issue.
Try to switch CarouselView to CoverFlowView (just replace one view with another. That's it)
Thank you. Interesting, switching to CoverFlowView seems to be better, but still calculates heights incorrect in some cases, but this time too short. Also I get this strange zoom in/out bounce animation when you switch pages?
Yes, you probably switch indices from VM? For example set index = 2 when it was 0?
If yes, then it's expected
But yeah, I think I need the reproduction sample
Also, I propose to load the page not when the card is built, but when the card is appearing
It works this way:
I'm deleting emails because they can be quite big, also WebView itself is probably heavy on resources?
Thanks again for your support, really appreciate it.
@dzebas sorry, I don't think I can help much here w/out reproduction. if this issue exists with other carousels then it's not related to CardsView. That's more about your approach to achieving your design goals.
It can be a WebView issue then.
Closing this issue as I can't help
Hi,
I've a complex situation, will try to describe as much as I can, sorry for a long explanation.
I'm trying to build something similar to Gmail/Outlook email apps, so user can swipe between emails and also scroll up/down inside email. You'll notice in my XAML below that I use custom WebView renderer (to set WebView height same as contents) inside another ScrollView so everything can be scrolled - subject, to/from, email body etc.
When ItemAppeared is triggered I'm retrieving email from the server and adding at then end of ItemsSource.
Problem 1:
If I scroll up/down on current carousel page, then OnPageFinished in WebView rendered is triggered for next page and height is not calculated correctly (probably because page it's not visible yet?). If instead of up/down I scroll to the left so next page gets visible then height is correct.
Problem 2:
If I comment await System.Threading.Tasks.Task.Delay( 100 ); in .ItemAppeared then page height is never calculated correctly.
Expected Results:
I think if I don't scroll to next page it's layout should not be calculated?
My XAML:
Custom WebView renderer: