Bug 39833 - On WinRT 8.1 using 2.1.0.6529, data wrapped in a ScrollView is not visible
Summary: On WinRT 8.1 using 2.1.0.6529, data wrapped in a ScrollView is not visible
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.1.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Samantha Houts [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2016-03-22 12:10 UTC by John Hardman
Modified: 2017-06-19 22:11 UTC (History)
5 users (show)

Tags: WinRT 8.1 ScrollView nested
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 John Hardman 2016-03-22 12:10:39 UTC
I use a horizontal ScrollView inside a vertical ScrollView. This used to work fine, but after upgrading to 2.1.0.6529 it has stopped working on WinRT 8.1 (it is fine on UWP, Android and iOS). What now happens on WinRT 8.1 is that the content of the horizontal ScrollView is not visible.

As a workaround, I have removed the ScrollView temporarily, so my code ends up as follows. This method is passed the View (typically a StackLayout) that is to be wrapped in a horizontal ScrollView. It normally returns the ScrollView, but as a workaround is just returning the StackLayout on WinRT 8.1 . Please investigate why ScrollView on WinRT 8.1 is no longer working as expected, so that I can remove this (not great) workaround.

        private static View WrapContentInScrollView(View content)
        {
            // workaround for bug on Windows Store
            if (ApplicationType.IsWindows()) // this is a helper of mine that returns true if the app was built for WinRT 8.1
                return content;
            else
            {
                ScrollView svButtons = new ScrollView
                {
                    BackgroundColor = Color.White,
                    HorizontalOptions = LayoutOptions.StartAndExpand,
                    Orientation = ScrollOrientation.Horizontal,
                    Padding = 2,
                    VerticalOptions = LayoutOptions.Fill,
                    Content = content
                };

                return svButtons;
            }
        }
Comment 1 Paul DiPietro [MSFT] 2016-03-22 19:12:43 UTC
2D scrolling is coming in 2.2 so this shouldn't be an issue any more.
Comment 2 John Hardman 2016-03-22 23:58:13 UTC
There may be a different way of doing things in 2.2, but the current way of doing things still has a bug. Even in 2.2 (which isn't yet released), the old way should still work. This should not be marked as RESOLVED FIXED, hence REOPENED.
Comment 3 Paul DiPietro [MSFT] 2016-03-23 00:04:27 UTC
I should add that I was not able to reproduce this using the mentioned version, so if you have a reproduction you can upload it would be appreciated.
Comment 4 Samantha Houts [MSFT] 2017-01-06 00:23:57 UTC
I have tried to reproduce this issue with the following code using the latest stable Xamarin.Forms:

var view = new StackLayout { Orientation = StackOrientation.Horizontal };

for (int i = 0; i < 100; i++)
{
	view.Children.Add(new Button { TextColor = Color.Black, Text = i.ToString() });
}

var hScrollView = new ScrollView()
{
	BackgroundColor = Color.White,
	HorizontalOptions = LayoutOptions.StartAndExpand,
	Orientation = ScrollOrientation.Horizontal,
	Padding = 2,
	VerticalOptions = LayoutOptions.Fill,
	Content = view
};
var newScrollView = new ScrollView() { Content = hScrollView };
Content = newScrollView;

I was unable to reproduce the issue described. The content is visible and scrollable.

Can you please compare this code sample with your code and let me know what additions will cause the bug to appear?

Warm regards,
Xamarin Forms Team
Comment 5 Chris King 2017-06-19 17:22:46 UTC
Assigned to you as you were last to request additional info.
Comment 6 Paul DiPietro [MSFT] 2017-06-19 17:53:55 UTC
This issue will be closed due to a lack of response, and as Samantha was unable to reproduce it, we can reasonably assume it is working as expected -- that said, please reopen this and attach a minimized reproduction project if the issue still exists as of the latest prerelease or nightly build and we'll take a look at it.
Comment 7 John Hardman 2017-06-19 22:11:19 UTC
Just to let you know - I no longer do WinPhone 8.0 SL or WinRT 8.1 builds, so any bugs raised by me against Windows platforms prior to Windows 10 can (from my point of view) be closed unless anybody else is still reporting the same problems. The exception of course, is if WinRT code is shared with UWP, in which case further investigation could make sense.