yonat / MultiSlider

UISlider clone with multiple thumbs and values, range highlight, optional snap intervals, optional value labels, either vertical or horizontal.
MIT License
494 stars 113 forks source link

Slider not showing inside UIStackView #32

Closed vendulasvastal closed 4 years ago

vendulasvastal commented 5 years ago

Description of the problem:

I have made an instance of the slider and simply added it as and arranged subview to my stack view but the slider is shown in a very weird way. I am attaching an image where the blue line is supposed to be the slider. I have also tried to change its orientation to .horizontal but it did not help

    private var slider: MultiSlider = MultiSlider()
    stack.addArrangedSubview(slider)
Snímek obrazovky 2019-10-08 v 12 51 25
yonat commented 5 years ago

Works for me...
Please link to a project that reproduces the problem.

xaepstudio commented 4 years ago

I am seeing the same issue -- since the slider.orientation property is not exposed in IB, I set slider orientation in code using slider.orientation = horizontal to configure a horizontal slider. However, this means that all sliders are shown in vertical orientation in IB -- as shown in @svastven posted image. I am using the latest version of MultiSlider with Xcode Version 11.2.1 (11B53).

yonat commented 4 years ago

Ah, in IB! I added isVertical property that can be changed in IB, please update your pod to 10.0.1.

xaepstudio commented 4 years ago

Works perfectly!

Thank you yonat 🙏🏽