spacenation / swiftui-sliders

:rocket: SwiftUI Sliders with custom styles
MIT License
793 stars 84 forks source link

Range slider in documentation example only displays one handle #32

Closed AdrianBinDC closed 2 years ago

AdrianBinDC commented 3 years ago
RangeSlider(range: $model.range2)
    .rangeSliderStyle(
        HorizontalRangeSliderStyle(
            track:
                HorizontalRangeTrack(
                    view: Capsule().foregroundColor(.purple)
                )
                .background(Capsule().foregroundColor(Color.purple.opacity(0.25)))
                .frame(height: 8),
            lowerThumb: Circle().foregroundColor(.purple),
            upperThumb: Circle().foregroundColor(.purple),
            lowerThumbSize: CGSize(width: 32, height: 32),
            upperThumbSize: CGSize(width: 32, height: 32),
            options: .forceAdjacentValue
        )
    )

This is what's rendered:

Screen Shot 2021-04-18 at 7 34 36 AM
noura-rizk commented 3 years ago

Make sure range values is between 0 and 1, and it should work