Skip to content

Commit

Permalink
fixed a bug: no redrawing when text has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
xcatsan committed Sep 29, 2011
1 parent 866acd8 commit 11130ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions LKBadgeView.m
Expand Up @@ -259,24 +259,34 @@ - (void)setText:(NSString *)text
self.displayinText = text;

[self _adjustBadgeFrame];
[self setNeedsDisplay];
}

- (void)setHorizontalAlignment:(LKBadgeViewHorizontalAlignment)horizontalAlignment
{
horizontalAlignment_ = horizontalAlignment;
[self _adjustBadgeFrameX];
[self setNeedsDisplay];
}

- (void)setWidthMode:(LKBadgeViewWidthMode)widthMode
{
widthMode_ = widthMode;
[self _adjustBadgeFrameWith];
[self setNeedsDisplay];
}

- (void)setOutlineWidth:(CGFloat)outlineWidth
{
outlineWidth_ = outlineWidth;
[self _adjustBadgeFrame];
[self setNeedsDisplay];
}

- (void)setOutline:(BOOL)outline
{
outline_ = outline;
[self setNeedsDisplay];
}

#pragma mark -
Expand Down
2 changes: 1 addition & 1 deletion SampleApplication/LKBadgeViewViewController.m
Expand Up @@ -109,7 +109,7 @@ - (IBAction)changeOutlineSwitch:(id)sender

badgeView.outlineWidth = 2.0;

[badgeView setNeedsDisplay];
// [badgeView setNeedsDisplay];
}
}
self.badgeView41.textColor = [UIColor greenColor];
Expand Down

0 comments on commit 11130ce

Please sign in to comment.