Slider自定义滑动时,滑动点为透明时,互动到最右边后,仍然和右边边距有间隙的问题
- (CGRect)thumbRectForBounds:(CGRect)bounds trackRect:(CGRect)rect value:(float)value
{
rect.origin.x = rect.origin.x - 13 ;
rect.size.width = rect.size.width +26;
CGRect result = [super thumbRectForBounds:bounds trackRect:rect value:value];
lastBounds = result;
return CGRectInset (result, 13 , 13);
}
本文介绍了一种解决iOS中Slider滑动时,滑动点为透明时互动到最右边仍与右边边距存在间隙的方法。通过调整thumbRect的位置和大小来确保滑动到最右侧时能够准确对齐。
2276

被折叠的 条评论
为什么被折叠?



