Skip to content

Commit

Permalink
Merge pull request #152 from michelzanini/master
Browse files Browse the repository at this point in the history
Centralise arrow when the text is empty
  • Loading branch information
samvermette committed Sep 26, 2013
2 parents 70496a5 + e424e65 commit bdb5404
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion SVPullToRefresh/UIScrollView+SVPullToRefresh.m
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,14 @@ - (void)layoutSubviews {
lineBreakMode:self.subtitleLabel.lineBreakMode];

CGFloat maxLabelWidth = MAX(titleSize.width,subtitleSize.width);
CGFloat totalMaxWidth = leftViewWidth + margin + maxLabelWidth;

CGFloat totalMaxWidth;
if (maxLabelWidth) {
totalMaxWidth = leftViewWidth + margin + maxLabelWidth;
} else {
totalMaxWidth = leftViewWidth + maxLabelWidth;
}

CGFloat labelX = (self.bounds.size.width / 2) - (totalMaxWidth / 2) + leftViewWidth + margin;

if(subtitleSize.height > 0){
Expand Down

0 comments on commit bdb5404

Please sign in to comment.