KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I know this is a noob question but ...I have these labels on a tableview, but the text is completely squished to the left. I want to add a bit of padding. How do I go about it? - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView* customView = [[[UIView alloc] initWithFrame:CGRectMake(10,0,300,60)] autorelease]; UILabel *headerLabel = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease]; headerLabel.backgroundColor = [UIColor colorWithHexString:[[_months objectAtIndex:section] objectForKey:@"color"]]; headerLabel.font = [UIFont boldSystemFontOfSize:18]; headerLabel.frame = CGRectMake(0,0,400,30); headerLabel.text = [[_months objectAtIndex:section] objectForKey:@"name"]; headerLabel.textColor = [UIColor whiteColor]; [customView addSubview:headerLabel]; return customView; } any help is much appreciated! Thanks!
Tags (comma-separated)
Save Edits
Cancel