This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 29110 - VerticalOptions = LayoutOptions.Center or CenterAndExpand, of Sliders on Windows Phone does not result in centered display
Summary: VerticalOptions = LayoutOptions.Center or CenterAndExpand, of Sliders on Wind...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows (show other bugs)
Version: 1.4.2
Hardware: PC Windows
: Normal minor
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-04-15 05:13 UTC by John Hardman
Modified: 2016-12-05 10:47 UTC (History)
3 users (show)

See Also:
Tags: WindowsPhone WinPhone Slider VerticalOptions Center CenterAndExpand AC
Is this bug a regression?: ---
Last known good build:


Attachments

Description John Hardman 2015-04-15 05:13:35 UTC
When Sliders are given VerticalOptions equal to Center of equal to CenterAndExpand, the result is as expected on iOS and Android, but not on Windows Phone. The code below can be used to demonstrate this. I would expect the Label and the Slider to consistently appear centered around the same vertical point. However, the Slider appears higher than expected. The same happens, whether embedded in a Grid, a StackLayout etc.


using Xamarin.Forms;

namespace SliderAlignmentIssue
{
    public class App : Application
    {
        public App()
        {
            Grid sliderGrid = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition { Width = GridLength.Auto },
                    new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) },
                },
                Children =
                {
                    { 
                        new Label 
                        { 
                            Text = "Label: ",
                            VerticalOptions = LayoutOptions.CenterAndExpand,
                            YAlign = TextAlignment.Center
                        }, 0, 1 
                    },
                    { 
                        new Slider 
                        {
                            VerticalOptions = LayoutOptions.CenterAndExpand,
                            BackgroundColor = Color.Blue,
                            Maximum = 255,
                            Minimum = 0
                        }, 1, 1
                    }
                }
            };

            // The root page of your application
            MainPage = new ContentPage
            {
                Content = sliderGrid
            };
        }

        protected override void OnStart()
        {
            // Handle when your app starts
        }

        protected override void OnSleep()
        {
            // Handle when your app sleeps
        }

        protected override void OnResume()
        {
            // Handle when your app resumes
        }
    }
}
Comment 1 John Miller 2016-01-04 19:01:43 UTC
I am able to reproduce this using the sample code and XF 2.0 on WP 8.
Comment 2 Rui Marinho 2016-12-05 10:47:25 UTC
Should le fixed in 2.3.4-pre2

Note You need to log in before you can comment on or make changes to this bug.