Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue on Android with latest version of Forms 2.2.0.31 #24

Open
mannyvw opened this issue May 23, 2016 · 14 comments
Open

Issue on Android with latest version of Forms 2.2.0.31 #24

mannyvw opened this issue May 23, 2016 · 14 comments

Comments

@mannyvw
Copy link

mannyvw commented May 23, 2016

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

@QianPro
Copy link

QianPro commented May 24, 2016

same problem.

@mannyvw
Copy link
Author

mannyvw commented May 31, 2016

Anyone find a solution to this ? Have been trying all sorts of work arounds but nothing working :-(

@Liam-Tait
Copy link

Also having this issue

@mannyvw
Copy link
Author

mannyvw commented Jun 1, 2016

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);

@QianPro
Copy link

QianPro commented Jun 1, 2016

Yes, it works now! Thanks @mannyvm!

@JRolandros
Copy link

Thanks it works perfectly. Good work @mannyvw

@RimVo
Copy link

RimVo commented Jun 13, 2016

Works like a charm. Thank @mannyvw

@ppongsakorn
Copy link

It work!
Thank you.

@repper
Copy link

repper commented Jul 11, 2016

Many many thanks, it worked like a charm... :)

@twentytwokhz
Copy link

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?

@darylw
Copy link

darylw commented Mar 1, 2017

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.

@mannyvw
Copy link
Author

mannyvw commented Mar 1, 2017

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

@darylw
Copy link

darylw commented Mar 1, 2017

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.

@mannyvw
Copy link
Author

mannyvw commented Mar 1, 2017

Yeah my original UX had the pips too , i just did them programatically in forms, although they have been removed now. bloody designers ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants