diff --git a/StepSlider/source/StepSlider/StepSlider.m b/StepSlider/source/StepSlider/StepSlider.m index 62d5bd4..f8d20ea 100644 --- a/StepSlider/source/StepSlider/StepSlider.m +++ b/StepSlider/source/StepSlider/StepSlider.m @@ -143,8 +143,14 @@ - (void)layoutLayersAnimated:(BOOL)animated contentSize = CGSizeMake(fmaxf(44.f, self.bounds.size.width), fmaxf(44.f, sliderHeightWithLabels)); if (!CGSizeEqualToSize(self.bounds.size, contentSize)) { - [self invalidateIntrinsicContentSize]; - return; + if (self.constraints.count) { + [self invalidateIntrinsicContentSize]; + return; + } else { + CGRect newFrame = self.frame; + newFrame.size = contentSize; + self.frame = newFrame; + } } CGFloat contentFrameY = (self.bounds.size.height - sliderHeightWithLabels) / 2.f;