Skip to content

Instantly share code, notes, and snippets.

@fredriktelenius
fredriktelenius / gist:797315
Created January 26, 2011 19:53
Default header font in UITableView
-(id) initWithHeader:(NSString*) header {
if (self = [super initWithFrame:CGRectMake(0.0, 0.0, 320.0, 40.0)]) {
CGSize stringBoundingBox = [header sizeWithFont:[UIFont boldSystemFontOfSize:17]];
[self setBackgroundColor:[UIColor groupTableViewBackgroundColor]];
self.activityIndicator = [[UIActivityIndicatorView alloc]
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
CGRect frame = [self.activityIndicator frame];
frame.origin.x = stringBoundingBox.width + 30.0;
frame.origin.y = 17.0;