What is the exact size (width, height) of the (default) thumb image for the iOS slider? Is there perhaps some clever way to coax this out of the system (XCode, iOS)?
I tried
int thumbWidth = slider.currentThumbImage.size.width;
which I found here on this site, but it comes back with 0.
Additional question: The Xcode debugger shows this undocumented variable in the UISlider
: CGFloat _hitOffset
. Does anyone by chance know what it is and what it's for?
There is a session video about UI customization in the WWDC 2012 collection:
https://developer.apple.com/videos/wwdc/2012/?id=216
You might find your answer here. Its about UISlider customization too
The best way is using a Resizable Image. But the slider thumb size is 23x23 if you don't want to make the image resizable
Here is the swift 4 version:
If you want change UISlider appearance then use below method
as well as below code would change you slider track also
Aplle HIG document doesn't define any size for UISlider thumb image but it should be under normal image size.
What about this? Works for me: