xamarin-forms-carouselview
xamarin-forms-carouselview copied to clipboard
Issue on Android with latest version of Forms 2.2.0.31
Hi
This was working great with older version of forms! Was going down a similar route, then found your code saving me loads of time. Good Work!
However our app I am integrating into uses latest version of forms. Works fine on iOS, but on android the line
_scrollView = (HorizontalScrollView)typeof(ScrollViewRenderer)
.GetField ("hScrollView", BindingFlags.NonPublic | BindingFlags.Instance)
.GetValue (this);
Am guessing ScrollView layed out differently in forms 2.2, how did you browse the properties to find the HorizontalScrollView?
thanks
N
same problem.
Anyone find a solution to this ? Have been trying all sorts of work arounds but nothing working :-(
Also having this issue
OK Fixed it. Name of property has changed to an _hScrollView. Easy when you know how!
_scrollView = (HorizontalScrollView)typeof(ScrollViewRenderer)
.GetField ("_hScrollView", BindingFlags.NonPublic | BindingFlags.Instance)
.GetValue (this);
Yes, it works now! Thanks @mannyvm!
Thanks it works perfectly. Good work @mannyvw
Works like a charm. Thank @mannyvw
It work! Thank you.
Many many thanks, it worked like a charm... :)
I am still having trouble with the CarouselLayoutRenderer.cs At line 40 with latest code from git and latest Xamarin version the _scrollView is still null. What can I do?
It's worth pointing out here that if you are on a version of Xamarin forms lower than 2.2.0.31, then the reverse of this applies. I.e. the original post by @mannyvw which contains the field "hScrollView" is the correct line, rather than "_hScrollView". The reason I point this out is that the code has been updated to include the newer field, so this code on older versions of forms will break.
Perhaps it might be ideal to check for the existence of the original, and then use the newer one, so that it works with both? Just a thought.
Either way, great post @mannyvw - this saved me a lot of time.
Thanks . As an update in a new project I started I also needed a carousel view and there is actually an official from Xamarin now, it was supposed to be included in Xamarin Forms 2.3.0, but it was removed because of stability issues ? anyway it has its own NuGet instead. have been using it on android and ios for past few months and its been fine.
https://xamarinhelp.com/carousel-view-xamarin-forms/
NuGet is Xamarin.Forms.CarouselView
thanks
Cheers for that - I had been keeping an eye on that, but the one thing that was crucial to this for me for UX reasons was the page indicators. This solution contains it from the start, and they are customisable as well, so was absolutely ideal. When Xamarin implement the indicators as well, then I may well switch over to theirs. Thanks for the prompt feedback - appreciated.
Yeah my original UX had the pips too , i just did them programatically in forms, although they have been removed now. bloody designers ;-)