I’m trying to offset the x/y position of a UISlider’s min and max value images.
Currently, I’m sublcassing UISlider and am setting the maximum value image like this:
[self setMaximumValueImage:[UIImage imageNamed:@"circle_with_plus"]];
However, I need this image to be closer to the actual UISlider and have little control over visual assets on this project. I’ve tried using
- (CGRect)maximumValueImageRectForBounds:(CGRect)bounds
However, I’m my min/max value images may change size dynamically so I’m not sure how to properly implement it in this case. Is there a different way to move the asset?
Thanks
No, there is no other way to reposition the minimum or maximum value images.
maximumValueImageRectForBounds:gets invoked every time the slider lays out its subviews, and laying out the subviews happens whenever you change themaximumValueImage, so it is sufficient to do: