iOS uislider滑轨宽度调宽和滑轨调宽后滑不到最右边出现
2024-05-14 本文已影响0人
wodeph
//// 改变滑条的宽度
- (CGRect)trackRectForBounds:(CGRect)bounds {
returnbounds;
}
//改变宽度后,滑到右边会出现直角的多余的情况,以下宽度加20就是完整覆盖
- (CGRect)thumbRectForBounds:(CGRect)bounds trackRect:(CGRect)rect value:(float)value{
rect.origin.x= rect.origin.x-10;
rect.size.width= rect.size.width+20;
return CGRectInset([super thumbRectForBounds:bounds trackRect:rect value:value],10,10);
}