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

When the progress is at 0, the label doesn't show up #48

Open jlubeck opened 8 years ago

jlubeck commented 8 years ago

It looks like for some reason with a 0% label, it doesn't show up. But it would be nice to have it, as otherwise it looks like the bar is broken or something...

Thank you

yannickl commented 8 years ago

Which indicatorTextDisplayMode are you using?

Have you tried with YLProgressBarIndicatorTextDisplayModeFixedRight or YLProgressBarIndicatorTextDisplayModeFixedLeft?

jlubeck commented 8 years ago

YLProgressBarIndicatorTextDisplayModeProgress

Haven't tried the others one, as having the text go with the progress looks the best. Isn´t it possible to have it behave as it is, but when it´s close to the left, just fix it so it's still seen?

Where should I check in the code to try and do it myself and maybe do a pull request?

Thanks!

yannickl commented 8 years ago

An issue can occurred if the text color and the background's track have a low contrast ratio.

To avoid breaking the current behaviour you should create a new YLProgressBarIndicatorTextDisplayMode.

And then managing the display here and may be in the drawText:withRect: