o Bugfix: set label background and text color
Showing
1 changed file
with
17 additions
and
0 deletions
@@ -116,6 +116,23 @@ | @@ -116,6 +116,23 @@ | ||
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
119 | +- (void)setTextBackgroundColor:(UIColor *)newTextBackgroundColor | ||
120 | +{ | ||
121 | + [textBackgroundColor autorelease]; | ||
122 | + textBackgroundColor = [newTextBackgroundColor retain]; | ||
123 | + | ||
124 | + self.label.backgroundColor = textBackgroundColor; | ||
125 | +} | ||
126 | + | ||
127 | +- (void)setTextForegroundColor:(UIColor *)newTextForegroundColor | ||
128 | +{ | ||
129 | + [textForegroundColor autorelease]; | ||
130 | + textForegroundColor = [newTextForegroundColor retain]; | ||
131 | + | ||
132 | + if ([self.label respondsToSelector:@selector(setTextColor:)]) | ||
133 | + ((UILabel *)self.label).textColor = textForegroundColor; | ||
134 | +} | ||
135 | + | ||
119 | - (void)changeLabelUsingText:(NSString *)text | 136 | - (void)changeLabelUsingText:(NSString *)text |
120 | { | 137 | { |
121 | CGPoint position = CGPointMake([self bounds].size.width / 2 - [text sizeWithFont:[RMMarker defaultFont]].width / 2, 4); | 138 | CGPoint position = CGPointMake([self bounds].size.width / 2 - [text sizeWithFont:[RMMarker defaultFont]].width / 2, 4); |
-
Please register or login to post a comment