Xamarin.forms: horizontal Scrollview breaks scrolling when flowdirection is set to rtl

Created on 9 Jun 2018  路  12Comments  路  Source: xamarin/Xamarin.Forms

Description

As in the title the horizontal scrollview doesnt allow you to scroll anymore if you set its flowdirection to righttoleft

Steps to Reproduce

  1. make a scrollview with orientation set to horizontal
  2. set its flowdirection to righttoleft

Expected Behavior

scrolling working

Actual Behavior

scrolling does not work

Basic Information

  • Version with issue: 3.1.0.550168-pre3
  • IDE: visual studio 2017
  • Platform Target Frameworks:

    • iOS: not sure if it exists in ios

    • Android: oreo

    • UWP: don't use it

Related to

issue: #1222

rtl 3 high impact bug

Most helpful comment

@smartprogrammer93 I'm excited that you're testing nightlies!!!

Once there's a package to test I'll let you know

This was a fun one so it'd be great for you to verify!!

All 12 comments

I managed to workaround this by
for android:
setting the viewgroup.layoutdirection
for ios:
seting the contentoffeset to the end

It looks like the problem stems from an error in measuring the ScrollViewContainer.
We managed to create a working workaround for this issue RtlScrollViewFix.
There is a secondary bug, that in RTL mode, the scrollbar starts from the left side, which in RTL is the end. This issue is covered by the workaround a well.

@danielkatz thank you for the solution project that's been very helpful. The current problem I'm looking into is that the solution you have only works because the minSdkVersion is set to 19

If I set it back down to 15 then it doesn't work on the scrollview is just stuck

@PureWeen I didn't test it this far back, but my first suspect will be the ScrollX handling that was glitchy even on 19+.
Would the solution work without the whole block at line 83?

@PureWeen Besides, according to the docs, RTL is supported from API 17+, so prior to 17 the whole thing can be disabled...

Yea I realize that about the API 17+ but if I just setup a native Xamarin Android app with a horizontal scrollview set to RTL and the minSdkVersion set to 15 the whole thing works fine

Still breaks scrolling as of xamarin 3.3.0.689585-nightly
Sorry for being impatient, really wanted to check if it works now.

@smartprogrammer93 this fix hasn't been merged up from 3.1 yet to master

@PureWeen ops, sorry my bad, just excited.

Thanks for the hard work

@smartprogrammer93 I'm excited that you're testing nightlies!!!

Once there's a package to test I'll let you know

This was a fun one so it'd be great for you to verify!!

@smartprogrammer93 so it was only out with the nightly briefly but this fix is part of the service release

https://www.nuget.org/packages/Xamarin.Forms/3.1.0.697729

Was this page helpful?
0 / 5 - 0 ratings