UIPopover Comment puis-je faire une liste avec des boutons comme ça?

UIPopover Comment puis-je faire une liste avec des boutons comme ça?

Je me demande comment je peux créer une liste avec des boutons comme ça.

RÉPONSE:

UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle: nil 
                                                          delegate: self
                                                 cancelButtonTitle: nil 
                                            destructiveButtonTitle: nil 
                                                 otherButtonTitles: @"Take Photo",
                                                                    @"Choose Existing Photo", nil];

[actionSheet showFromRect: button.frame inView: button.superview animated: YES];

Quelque part d'autre dans votre délégué de la classe d'objet...

-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (buttonIndex == 0) {
         //take photo...
    } 
    else if (buttonIndex == 1) {
         //choose existing photo...
    }
}
InformationsquelleAutor ManOx | 2012-05-24