Bug 56947 - macOS: ScrollView's content are showing at End.
Summary: macOS: ScrollView's content are showing at End.
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: unspecified
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Rui Marinho
URL:
Depends on:
Blocks:
 
Reported: 2017-05-29 19:49 UTC by Brad Chase
Modified: 2017-06-21 15:50 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED FIXED

Description Brad Chase 2017-05-29 19:49:50 UTC
ScrollView set to vertical on macOS are showing at the bottom of the scroll's contents rather than where the child is stating it should be located.

To repro, take a scroll view set to fill, set to vertical, add child with vertical set to start.  It will show at the bottom of the scrollview.
Comment 1 Brad Chase 2017-05-30 00:27:51 UTC
After playing with it a bit I found that wrapping the ContentView in a new NSView and setting that view's size will get the correct layout.

I can put up that change if you guys would like but there are other issues that I believe are causing the problem.  So even if wrapping fixes it, there are other problems that still need solved.

For instance if you resize the screen the scroll view will never go back to its original spot unless you change the horizontal size of the screen.

For testing I wanted to make sure that End alignment still worked and found that with the new and original code, it renders half way off screen.  So that will still need fixed.

That means that the other problems are all there with the original code.  So wrapping it will fix THIS bug but will not fix the others.  I can spend some more time and investigate but I am new to the macOS layout system.  I can also put a PR up.  Its up to you guys.
Comment 2 Brad Chase 2017-05-30 00:39:10 UTC
Also wanted to add that the ContentView's IsFlipped is set to false.
Comment 3 Brad Chase 2017-06-12 22:06:52 UTC
I should have a PR up tomorrow with the fix.
Comment 4 Brad Chase 2017-06-14 20:59:44 UTC
Link back to the PR for reference and discussion:

https://github.com/xamarin/Xamarin.Forms/pull/993

And I do welcome discussion on this.  I hope there is an easier way of fixing this but I could not find one and I exhausted my research into how macOS behaves with the ScrollView.  I believe most of the issues are in Xamarin's layout code fighting with macOS's inverted layout code.  Any better ideas would be really appreciated.

As far as that goes, if we never update Xamarin's ScrollViewer, this is easily fixed with very minimal code.  But we cant do that.
Comment 5 Rui Marinho 2017-06-21 15:50:13 UTC
Should be fixed on 2.3.6-pre1