Quiero que mi tableView muestre 6 filas con texto, en este caso "Ejemplo". Por lo que puedo decir, tengo mi numberOfSectionsInTableView:
y numberOfRowsInSection:
establecidos correctamente. Consulte el código de ejemplo a continuación:UITableView que muestra más filas que las especificadas en numberOfRowsInSection:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
// Return the number of rows in the section.
return 6;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = @"Example";
return cell;
}
El problema es cuando se ve la imagen de abajo muestra las líneas de filas que no/debería no existen.
¿Cómo deshacerse de las líneas que muestran fila pasado 6?
Este es el comportamiento por defecto de todas las vistas de tabla lisos con un menor número de filas que se necesita para desplazarse, así que simplemente establecer el número de filas y secciones no ayudará. Necesitarás encontrar otra forma ... – BoltClock