Closed blixt closed 8 years ago
Trying to use uploadProgress.roundedCornersWidth = 3;
(and 4
) doesn't change the appearance at all, while using uploadProgress.roundedCornersWidth = 2;
results in the rounded corners disappearing altogether:
This is odd. Did you try explicitly setting uploadProgress.roundedCorners = YES;
?
@kirualex Specifying roundedCorners = YES
doesn't change anything (which I guess is because it's the default?) and setting them to NO
gives the expected appearance (like the second screenshot above).
hmmm, could you try with the dev branch? I think there may be a bug on the 3.0 here... I'll try to patch this up tomorrow.
I pushed a rather big refactoring : pod 'KAProgressLabel' => '3.1'
KAProgressTypeRect
, this library now focuses on circular progress. This also reduce code overhead.clockWise
property, the effect is achievable via startDegree
and endDegree
anywayroundedCorners
boolean property, roundedCornersWidth
now need an explicit value (default to 0)Let me know if you have issues with it, the adaptations should be straightforward. I may not be finished with refactoring, but this is a good start.
I tried out v3.1 and now the progress bars don't have rounded ends by default (like you said). If I set the roundedCornersWidth
property to 4
, I get this:
Here's the setup code:
KAProgressLabel *uploadProgress = [[KAProgressLabel alloc] initWithFrame:CGRectMake(0, 0, 26, 26)];
uploadProgress.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;
uploadProgress.center = CGPointMake(self.contentView.bounds.size.width - 36, self.contentView.center.y);
uploadProgress.hidden = YES;
uploadProgress.progressWidth = 4;
uploadProgress.roundedCornersWidth = 4;
uploadProgress.trackColor = [UIColor colorForRogerProgressBackground];
uploadProgress.trackWidth = 6;
[self.contentView addSubview:uploadProgress];
self.uploadProgress = uploadProgress;
Shouldn't -(void)drawRect:(CGRect)rect
in KAProgressLabel.m
rely on self.bounds
instead of rect
if it's not planned to redraw only the part of the KAProgressLabel
's frame? I've had the same issue and replacing rect
with self.bounds
there worked for me. Unfortunately, couldn't pull together a demo to show this kind of behaviour.
@kosyak I don't really understand where the problem is with relying on the rect
parameter. Could you provide some more details on this in a dedicated issue? (I'm closing this one)
@kirualex Why close this one? The bug still persists (see my last post, the circles are outside the progress bar). Is there another issue tracking this bug?
My bad I thought it was, reopening
After some fiddling I'm scratching my head on this one, I'll have a look next week.
I am also having this problem.
progressView.trackWidth = 6.0 progressView.progressWidth = 6.0 progressView.roundedCornersWidth = 5.0
@kirualex, @hobbesthetige I've come across the same issue and the easiest way to resolve the problem is just subclass UIView instead of UILabel.
Way too late to report, but in my case, https://github.com/kirualex/KAProgressLabel/commit/2cb335ccd57d44ee825902c496e6029874f771f4 resolved this issue 👍
This configuration worked in v2.1.
Here's how I set it up: