[英]Adjusting UISlider thumb image
這是您的自定義滑塊,因此請覆蓋thumbRect(forBounds:...)
; 這就是它的用途。
https://developer.apple.com/documentation/uikit/uislider/1621344-thumbrectforbounds
例如,你可能會說
override func thumbRect(forBounds bounds: CGRect, trackRect rect: CGRect, value: Float) -> CGRect {
return super.thumbRect(forBounds: bounds, trackRect: rect, value: value)
.offsetBy(dx: 0, dy: -7)
}
除了您可以通過眼球調整dy
值。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.