Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @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
Add Comment
Please, Sign In to add comment