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

Wrong cornerRadius when device orientation changes #31

Open alexmorral opened 9 years ago

alexmorral commented 9 years ago

When the device is rotated, the cornerRadius is not updated/calculated for the current device orientation.

yannickl commented 9 years ago

Hi,

I can't reproduce it. How do you manage the rotation? Have you a sample code?

alexmorral commented 9 years ago

Hi, here is the code for initializing the progressBar:

    _progressBar.type                        = YLProgressBarTypeRounded;
    _progressBar.hideStripes                 = YES;
    _progressBar.hideTrack                   = NO;
    _progressBar.indicatorTextDisplayMode    = YLProgressBarIndicatorTextDisplayModeNone;
    _progressBar.behavior                    = YLProgressBarBehaviorDefault;
    _progressBar.progressBarInset            = 0;
    _progressBar.hideGloss                   = YES;
    _progressBar.cornerRadius                = 0; //May this line be the problem?

and here is what I use for autosizing: autosize

The wrong bar when the device is rotated (this time from portrait to landscape): wrongbar

and I don't manage the rotation, as in your example project you don't seem to manage it.

Thanks