How to make UISlider default thumb to be smaller like the ones in the iOS control center

后端 未结 5 540
孤独总比滥情好
孤独总比滥情好 2021-02-01 06:50

I\'m working on an app and I have a custom UISlider.
However, I\'m having some issues on how to make the default thumb to appear smaller like t

5条回答
  •  囚心锁ツ
    2021-02-01 07:53

    Here's an option for you, use a CGAffineTransform.

    Swift 4

    mySlider.transform = CGAffineTransform(scaleX: 0.85, y: 0.85)
    

    This will change the width and height of the slider, so you may need to realign it with your interface.

提交回复
热议问题