Skip to content

Commit

Permalink
Added implementation of intrinsicContentSize to support positioning i…
Browse files Browse the repository at this point in the history
…n AutoLayout.
  • Loading branch information
idpaterson committed Oct 24, 2013
1 parent b89f54b commit 84e2588
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions SMPageControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,15 @@ - (UIImage *)imageMaskForPage:(NSInteger)pageIndex

- (CGSize)sizeThatFits:(CGSize)size
{
CGSize sizeThatFits = [self sizeForNumberOfPages:self.numberOfPages];
CGSize sizeThatFits = [self sizeForNumberOfPages:self.numberOfPages];
sizeThatFits.height = MAX(sizeThatFits.height, MIN_HEIGHT);
return sizeThatFits;
return sizeThatFits;
}

- (CGSize)intrinsicContentSize
{
CGSize intrinsicContentSize = CGSizeMake(UIViewNoIntrinsicMetric, MAX(_measuredIndicatorHeight, MIN_HEIGHT));
return intrinsicContentSize;
}

- (void)updatePageNumberForScrollView:(UIScrollView *)scrollView
Expand Down Expand Up @@ -451,6 +457,8 @@ - (void)_updateMeasuredIndicatorSizes
if (self.pageIndicatorMaskImage) {
[self _updateMeasuredIndicatorSizeWithSize:self.pageIndicatorMaskImage.size];
}

[self invalidateIntrinsicContentSize];
}


Expand Down

0 comments on commit 84e2588

Please sign in to comment.