Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
On Android if you create a custom renderer for a ScrollView you receive OnTouchEvent calls as normal if you set it ScrollOrientation.Vertical. However if you set it to ScrollOrientation.Horizontal you do not get touch events.
I have attached a sample project to show this problem. In CustomScrollView.cs there is a WriteLine in OnTouchEvent but when you start the app and scroll it you receive no events.
It looks as though something intercepts the touch event. I am not sure what is causing it but having looked at the ScrollViewRenderer source I can see it contains a HorizontalScrollView container that it uses when orientation is set to ScrollOrientation.Horizontal. Somewhere OnInterceptTouch events blocks them and I reckon its in there.
Created attachment 16813 [details]
Solution with custom renderer showing the problem.
In order to allow bidirectional scroll, XF is using two scrollviews. When the scroll mode is horizontal, the horizontal scrollview is catching the touch event. Any custom renderer you implement will actually be deriving from the vertical scrollview (which happens to be the parent). That's why you're not seeing anything.
Should be fixed in 2.3.4-pre1
I have checked this issue with Xamarin.Forms 2.3.4-pre1 and I am still getting same issue as bug description.
Hence reopened this issue.
Could you please follow the screencast and let me know If I have missed anything.
@Parmendra, can you test on a device and see if it behaves the same?
Yes, I have checked this issue with MotoG(6.0.1) and I am getting same issue.
I tested this again on latest master and was unable to reproduce the issue. I suggest that you wait for 2.3.4-pre2 and test again.
Note that I don't have a MotoG. I tested it on S6.
The fix does work. Make sure you open the CustomScrollView and uncomment the ExportRenderer attribute in the test project.