Bug 39809 - Error in Xamarin.Forms.ScrollView example
Summary: Error in Xamarin.Forms.ScrollView example
Status: RESOLVED FIXED
Alias: None
Product: Documentation
Classification: Xamarin
Component: Multi-Platform ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: CraigD
URL:
Depends on:
Blocks:
 
Reported: 2016-03-21 14:30 UTC by blitzillu
Modified: 2017-05-25 21:45 UTC (History)
1 user (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 blitzillu 2016-03-21 14:30:42 UTC
The C# example on https://developer.xamarin.com/api/type/Xamarin.Forms.ScrollView/ is not correct. 'stack' is not defined. It should be something like this:

StackLayout stack = new StackLayout {
    Padding = new Thickness (20),
};
var scrollview = new ScrollView {
  Content = stack,
};

for (var i=0; i<100; i++)
  stack.Children.Add (new Button { Text = "Foo"});
Comment 1 CraigD 2017-05-25 21:45:06 UTC
Currently shows


-------

var stack = new StackLayout();

for (int i = 0; i < 100; i++)
{
    stack.Children.Add(new Button { Text = "Button " + i });
}

MainPage = new ContentPage
{
    Content = new ScrollView { Content = stack }
};

------