Created
August 15, 2010 11:46
-
-
Save alexeckermann/525409 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
/* | |
Example custom UIView implementation | |
------------------------------------ | |
Used as a custom UITableView header cell. | |
*/ | |
- (id)initWithFrame:(CGRect)frame { | |
if ((self = [super initWithFrame:frame])) { | |
userName = [[UILabel alloc] initWithFrame:CGRectMake(70, 16, (self.bounds.size.width - 70), 28)]; | |
[userName setNumberOfLines: 1]; | |
[userName setFont: [UIFont boldSystemFontOfSize:20.0]]; | |
[userName setContentMode:UIViewContentModeLeft]; | |
[userName setOpaque: NO]; | |
[userName setBackgroundColor:[UIColor clearColor]]; | |
[userName setTextColor:[UIColor colorWithHue:0.5611 saturation:0.92 brightness:0.66 alpha:1]]; | |
[userName setShadowColor:[UIColor colorWithHue:1 saturation:0 brightness:1 alpha:0.6]]; | |
[userName setShadowOffset: CGSizeMake(1, 1)]; | |
[userName setText: @"Loading..."]; | |
[self addSubview: userName]; | |
avatar = [[UIImageView alloc] initWithFrame:CGRectMake(12, 17, 46, 46)]; | |
[avatar setImage:[UIImage imageNamed:@"default-avatar.png"]]; | |
[avatar setOpaque: NO]; | |
[avatar setBackgroundColor:[UIColor clearColor]]; | |
[self addSubview: avatar]; | |
[self setBackgroundColor:[UIColor clearColor]]; | |
} | |
return self; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment