mirror of
https://github.com/zhigang1992/SVPullToRefresh.git
synced 2026-01-12 22:52:41 +08:00
Avoiding to add a margin to the arrow when the title text is empty. This will make the arrow centralized in the screen when there is no text.
This commit is contained in:
@@ -289,7 +289,14 @@ static char UIScrollViewPullToRefreshView;
|
||||
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){
|
||||
|
||||
Reference in New Issue
Block a user