- Change the parent of Slider from bgTrack to slidedTrack.
- Update the relative position of Slider Thumb.
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
panGestureDetector = new PanGestureDetector();
panGestureDetector.Attach(this);
panGestureDetector.Detected += OnPanGestureDetected;
panGestureDetector = new PanGestureDetector();
panGestureDetector.Attach(this);
panGestureDetector.Detected += OnPanGestureDetected;
+
+ this.Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Horizontal,
+ };
}
private void OnLayoutDirectionChanged(object sender, LayoutDirectionChangedEventArgs e)
}
private void OnLayoutDirectionChanged(object sender, LayoutDirectionChangedEventArgs e)
{
if (direction == DirectionType.Horizontal)
{
{
if (direction == DirectionType.Horizontal)
{
- bgTrackLength = this.Size2D.Width;
+ bgTrackLength = this.Size2D.Width - thumbImage.Size2D.Width;
}
else if (direction == DirectionType.Vertical)
{
}
else if (direction == DirectionType.Vertical)
{
- bgTrackLength = this.Size2D.Height;
+ bgTrackLength = this.Size2D.Height - thumbImage.Size2D.Height;
}
}
else if (type == IndicatorType.Image)
}
}
else if (type == IndicatorType.Image)
internal class SliderExample : ContentPage, IExample
{
private View rootContent;
internal class SliderExample : ContentPage, IExample
{
private View rootContent;
- private Slider slider, disabledSlider, completedSlider;
+ private Slider slider, disabledSlider, completedSlider, verticalSlider;
{
MinValue = 0,
MaxValue = 100,
{
MinValue = 0,
MaxValue = 100,
- WidthSpecification = LayoutParamPolicies.MatchParent,
+ WidthSpecification = 300,
};
rootContent.Add(slider);
};
rootContent.Add(slider);
MinValue = 0,
MaxValue = 100,
IsEnabled = false,
MinValue = 0,
MaxValue = 100,
IsEnabled = false,
- WidthSpecification = LayoutParamPolicies.MatchParent,
+ WidthSpecification = 300,
};
rootContent.Add(disabledSlider);
};
rootContent.Add(disabledSlider);
MinValue = 0,
MaxValue = 100,
CurrentValue = 100,
MinValue = 0,
MaxValue = 100,
CurrentValue = 100,
- WidthSpecification = LayoutParamPolicies.MatchParent,
+ WidthSpecification = 300,
};
rootContent.Add(completedSlider);
};
rootContent.Add(completedSlider);
+ verticalSlider = new Slider()
+ {
+ MinValue = 0,
+ MaxValue = 100,
+ CurrentValue = 100,
+ Direction = Slider.DirectionType.Vertical,
+ HeightSpecification = 200,
+ };
+ rootContent.Add(verticalSlider);
+
Content = rootContent;
}
}
Content = rootContent;
}
}