Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Vertical Slider

$
0
0

Hey Guys thanks in advance!
So I need a vertical slider. I only found this option but can't apply it on my Xamarin.forms slider! Please help.
https://forums.xamarin.com/discussion/3007/custom-vertical-uislider-example-anywhere

What I tried:
Step1: Rotation - Does not work because the slider will take the width of the Layoutbox anyway!
Step2: Stacklayout.Orientation - Does strange things.
Step3: CustomSlider - But there are not enough exposed settings achieve what I want!

class CustomSlider : Slider
    {
        public CustomSlider()
        {
            this.BackgroundColor = Color.Red;
            //this.Rotation = -90;
            //this.AnchorX = 0.5;
            //this.AnchorY = 0.5;

            System.Diagnostics.Debug.WriteLine(" ");
            System.Diagnostics.Debug.WriteLine(" ");
            System.Diagnostics.Debug.WriteLine(" ");
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: ID " + this.Id);
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: Bounds " + this.Bounds.ToString());
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: AnchorX " + this.AnchorX.ToString());
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: AnchorY " + this.AnchorY.ToString());
            System.Diagnostics.Debug.WriteLine(">> ");
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: RequestH " + this.HeightRequest);
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: RequestW " + this.WidthRequest);
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: Height " + this.Height);
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: Width " + this.Width);
            System.Diagnostics.Debug.WriteLine(">> ");
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: VOptionsA " + this.VerticalOptions.Alignment);
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: HOptionsA " + this.HorizontalOptions.Alignment);
            System.Diagnostics.Debug.WriteLine(">> ");
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: VOptionsE " + this.VerticalOptions.Expands);
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: HOptionsE " + this.HorizontalOptions.Expands);
            System.Diagnostics.Debug.WriteLine(">> ");
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: Scale " + this.Scale);
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: RotX " + this.RotationX);
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: RotY " + this.RotationY);
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: RotZ " + this.Rotation);
            System.Diagnostics.Debug.WriteLine(">> ");
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: TransX " + this.TranslationX);
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: TransY " + this.TranslationY);
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: XPos " + this.X);
            System.Diagnostics.Debug.WriteLine(">> CUSTOM SLIDER: YPos " + this.Y);
            System.Diagnostics.Debug.WriteLine(" ");
            System.Diagnostics.Debug.WriteLine(" ");
            System.Diagnostics.Debug.WriteLine(" ");
        }
    }

How can I make myself a slider that can be vertical from bottom to top, filling my Layout-Grid-Cell?
Or has someone an example? The XLabs ExtendedSlider does not have a vertical setting as well if I am correct.


Viewing all articles
Browse latest Browse all 77050

Trending Articles