Acabo de implementar un botón Cargar más en el pie de página de mi tableView, pero el pie de página siempre se desplaza con la tabla. El estilo de mi tableView es UITableViewStylePlain.TableView Footer se desplaza con la tabla
Por favor, podría decirme dónde me estoy equivocando.
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
UIView *footerView = nil;
if(footerView == nil) {
footerView = [[[UIView alloc] init] autorelease];
footerView.backgroundColor = [UIColor clearColor];
UIButton *button = [[UIButton alloc] init];
button.layer.cornerRadius = 7;
[button setFrame:CGRectMake(10, 3, 300, 44)];
[button setTitle:@"Load 20 more" forState:UIControlStateNormal];
[button.titleLabel setFont:[UIFont boldSystemFontOfSize:20]];
[button setBackgroundColor:[UIColor whiteColor]];
[button.titleLabel setTextColor:[UIColor blackColor]];
[button addTarget:self action:@selector(load20More) forControlEvents:UIControlEventTouchUpInside];
[footerView addSubview:button];
[button release];
}
if ([songInfo count] > 20 && count < 100) {
return footerView;
}
else
return nil;
}
¿Qué le gustaría que ocurra al presionar cargar más? – Cyprian
Cargar más funciona a la perfección, y no tendría ningún efecto en el desplazamiento del pie de página de tableView con la tabla. –