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

Change thumb size with CGRect #71

Closed vuralcelik closed 3 years ago

vuralcelik commented 3 years ago

Hi Yonat! I was trying to change thumb size with CGRect like:

    private func changeThumbSizes() {
        multiSlider.thumbViews.forEach { imageView in
            imageView.frame = CGRect(x: 0, y: 0, width: 160, height: 160)
        }
    }

But its not effect to the view frames. How can i achieve that ?

vuralcelik commented 3 years ago
    private func changeThumbSizes() {
        multiSlider.thumbViews.forEach { imageView in
            imageView.heightAnchor.constraint(equalToConstant: 160).isActive = true
            imageView.widthAnchor.constraint(equalToConstant: 160).isActive = true
        }
    }

Looks like this works. Thanks!