¿Cómo agregar relleno-izquierda en un UILabel creado mediante programación?
Sé que esta es una pregunta novata pero ... Tengo estas etiquetas en una vista de tabla, pero el texto está completamente aplastado a la izquierda. Quiero agregar un poco de relleno. ¿Cómo lo hago?
- (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;
}
¡Cualquier ayuda es muy apreciada! ¡Gracias