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

Customization of snap views #94

Closed DanDolog closed 1 year ago

DanDolog commented 1 year ago

Description: Nice slider. I just ran into the problem that there is no way for normal customization of Snap views

Problems I encountered when trying to implement this myself: I tried adding UIImage:

Screen Shot 2023-04-19 at 20 33 18

Result (not very good):

Screen Shot 2023-04-19 at 20 33 18

It would be cool to add normal customization of SnapViews by exposing a UIView or something like that. Thanks in advance!

DanDolog commented 1 year ago

@yonat It will also be very cool to add Thumbs customization by setting UIView and not UIImage

yonat commented 1 year ago

To change snap view, you can do:

for snapView in multiSlider.snapViews {
    snapView.alpha = 0.5 // or whatever change you want
}

For the thumb views, you can do:

multiSlider.thumbViews[0].image = someImage
multiSlider.thumbViews[1].image = anotherImage