Created
December 21, 2010 21:57
-
-
Save pier-oliviert/750689 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation RootView | |
- (void)drawRect:(CGRect)rect { | |
self.highlighted ? [[UIColor whiteColor] set] : [[UIColor blackColor] set]; | |
[self.text drawAtPoint:CGPointMake(5, 10) withFont:[UIFont systemFontOfSize:15.0]]; | |
} | |
- (void)setText:(NSString *)t { | |
[m_text release]; | |
m_text = nil; | |
m_text = [t retain]; | |
[self setNeedsDisplay]; | |
} | |
- (void)setHighlighted:(BOOL)h { | |
m_highlighted = h; | |
[self setNeedsDisplay]; | |
} | |
- (void)sizeToFit { | |
self.frame = CGRectMake(0, 0, 0, 44); | |
} | |
@synthesize text = m_text; | |
@synthesize highlighted = m_highlighted; | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment