Custom Section table

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView *cabeceraSeccion = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 30)]; cabeceraSeccion.backgroundColor = [UIColor colorWithHexadecimal:@"#576171" alpha:1.0]; UIView *lineaDivisora = [[UIView alloc] initWithFrame:CGRectMake(0, 21, tableView.bounds.size.width, 1)]; lineaDivisora.backgroundColor = [UIColor colorWithHexadecimal:@"#343A41" alpha:1.0]; UILabel *tituloCabeceraSeccion = [[UILabel alloc] initWithFrame:CGRectMake(10, 2, tableView.bounds.size.width - 10, 18)]; tituloCabeceraSeccion.adjustsFontSizeToFitWidth = YES; tituloCabeceraSeccion.backgroundColor = [UIColor clearColor]; tituloCabeceraSeccion.text = [NSString stringWithFormat:@"%@",[self tableView:tableView titleForHeaderInSection:section]]; tituloCabeceraSeccion.font = [UIFont boldSystemFontOfSize:15]; tituloCabeceraSeccion.textColor = [UIColor whiteColor]; [cabeceraSeccion addSubview:lineaDivisora]; [cabeceraSeccion addSubview:tituloCabeceraSeccion]; return cabeceraSeccion; }
seccion personalizada para tabla

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.