本文介绍了自定义UISlider(轨道图像高度)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我自定义 UISlider 。我可以设置一个高于通常的缩略图的自定义拇指图像,但是我设置较高的最小轨道图像时,我不能使轨道更高,但轨道高度保持不变。 应该是可能的,因为在iPad上的iPod /音乐应用程序音量滑块也较高的通常的滑块,你可以看到这里:I'm customizing a UISlider. I could set a custom thumb image that is higher than the usual thumb however I could not make the track higher when setting a higher minimum track image but the track height remained the same.It should be possible as in the iPod/Music App on the iPad the volume slider is also higher as the usual slider as you can see here:推荐答案您需要子类化滑块并覆盖 trackRectForBounds:方法,如下所示:You need to subclass the slider and override the trackRectForBounds: method, like this:- (CGRect)trackRectForBounds:(CGRect)bounds{ return bounds;} 这篇关于自定义UISlider(轨道图像高度)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-03 03:52