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.
The VerticalOptions property for Views seems to not be applied when running code, if the views are nested inside <StackLayout>. I have tried setting the property from both the XAML page and from the code-behind.
When taking a view out of StackLayout, It renders correctly.
I've tested on both Android and iOS. I am unable to set the property from the code behind as well.
Here's the xaml code
<?xml version="1.0" encoding="utf-8" ?>
<Label x:Name="label" HorizontalOptions="Center" VerticalOptions="Center" Text="Hello World."></Label>
<Slider x:Name="slider" ValueChanged="Slider_ValueChanged" HorizontalOptions="Center" VerticalOptions="Center" WidthRequest="250"></Slider>
And here's the code I tried in the code behind:
label.VerticalOptions = LayoutOptions.Center;
slider.VerticalOptions = LayoutOptions.Center;
slider.Value = 0.5;
Here's what it looks like on iOS - http://imgur.com/Bob8gmh
And here's what it looks like on Android - http://imgur.com/GFhx6qv
I am currently using Xamarin.Forms version 220.127.116.11
Windows 10, VS Community 2017
Here is a google drive link for the project zip.
Here is github link
I am an idiot. please close. sorry.