2010-12-01 12 views

Répondre

0

Pour ajouter un pied de page dans votre tableview vous devez implémenter

-(UIView *) tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section. 

dans votre UITableViewDelegate. Dans cette méthode, vous créez et renvoyez votre vue de pied de page personnalisée

+0

de répondre, si la vue de pied de page a plusieurs images, comment attraper l'événement touché? – likki

1

implémentez - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section. Laissez-le retourner une vue dans laquelle vous avez ajouté vos icônes.

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section 
{ 
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0,0, tableView.frame.size.width,tableView.frame.height)]; 

    UIImage *img = [UIImage imageNamed:@"nameofimage.png"]; 
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; 
    [button setBackgroundImage:img forState:UIControlStateNormal]; 
    [button addTarget:self 
       action:@selector(someSelector:) 
    forControlEvents:UIControlEventTouchUpInside] 
    [view addSubView: button]; 
    return [view autorelease] 
} 
+0

merci pour la réponse, si la vue de pied de page a plusieurs images, comment attraper l'événement touché? – likki

+0

utilisez UIButtons voir ma modification. – vikingosegundo