yannickl / YLProgressBar

UIProgressView replacement with an highly and fully customizable animated progress bar in pure Core Graphics
http://yannickloriot.com/library/ios/ylprogressbar/
MIT License
1.28k stars 186 forks source link

Show indicatorTextLabel.text on top of progress instead of getting overlapped #43

Closed peoplesoft closed 8 years ago

peoplesoft commented 8 years ago

Hi, First of all, what a great library. Thank-you for the effort!

My question. I was wondering if it would be possible to have the indicatorTextLabel text show above the progress instead of getting overlapped (see screenshot where the text "SOME TEXT" starts to hide behind the progress bar)

screen shot 2016-06-30 at 4 52 55 pm
NSArray *tintColors = @[[UIColor colorWithRed:33/255.0f green:180/255.0f blue:162/255.0f alpha:1.0f],
                            [UIColor colorWithRed:149/255.0f green:37/255.0f blue:36/255.0f alpha:1.0f];
  _progressBarRoundedSlim.progressTintColors        = tintColors;

    _progressBarRoundedSlim.hideStripes = YES;
    _progressBarRoundedSlim.trackTintColor = [UIColor whiteColor];
    _progressBarRoundedSlim.progressBarInset = 3;

    _progressBarRoundedSlim.indicatorTextLabel.text = @"SOME TEXT";
    _progressBarRoundedSlim.hideGloss = YES;

    _progressBarRoundedSlim.indicatorTextDisplayMode = YLProgressBarIndicatorTextDisplayModeTrack;
    _progressBarRoundedSlim.indicatorTextLabel.font  = [UIFont fontWithName:@"Arial-BoldMT" size:20];
    _progressBarRoundedSlim.indicatorTextLabel.textColor = [UIColor blackColor];

Thank-you.

yannickl commented 8 years ago

Hi,

Sorry for the late, I just published a new pod version with the possibility to do that with the YLProgressBarIndicatorTextDisplayModeFixedRight enum case. :)

_progressBarRoundedSlim.indicatorTextDisplayMode = YLProgressBarIndicatorTextDisplayModeFixedRight;

I hope it'll be ok for you!

peoplesoft commented 8 years ago

Brilliant! Thank-you :)