We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to change the Orientation of SfRangeSlider in Xamarin.Forms

How to change the orientation SfRangeSlider in Xamarin.Forms

 

Syncfusion SfRangeSlider allows us to change its orientation to Vertical or Horizontal. The code snippets and the steps to be followed to change the slider’s orientation is given below.

 

To change the Slider’s orientation follow the given procedure:

 

Step 1: Add all the necessary assemblies as instructed in our helping document.

 

Step 2: Create instance of SfRangeSlider and use Orientation property to set desire orientation. Default orientation will be Vertical

 

The below code illustrates the way to achieve this

 

Xaml Code:

 

<ContentPage.Content>
        <StackLayout x:Name="stack" Orientation="Vertical">
            <slider:SfRangeSlider x:Name="range" SnapsTo="None" Orientation="Horizontal"  Minimum="0" Maximum="100" ShowRange="true">
            </slider:SfRangeSlider>
        </StackLayout>
    </ContentPage.Content>

 

C# Code:

    SfRangeSlider slider = new SfRangeSlider();
            slider.Minimum = 0;
            slider.Maximum = 100;
            slider.Orientation = Orientation.Horizontal;
            slider.ShowRange = true;
            slider.SnapsTo = SnapsTo.None;
            StackLayout stack = new StackLayout();
            stack.Padding = new Thickness(2050);
            stack.Children.Add(slider);
            this.Content = stack;

 

 

 

 

 

 

 

 

 

 

 

SfRangeSlider in Horizontal orientation SfRangeSlider in Vertical orientation

 

 

/Users/pavendhankumar/Desktop/Horizontal.png

 

Article ID: Published Date: Last Revised Date: Platform: Control:
7664 04/13/2017 04/13/2017 Xamarin.Forms SfRangeSlider
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon