Per la visualizzazione di uno UIActionSheet, il box con vari pulsanti che si apre dal basso, basta utilizzare il seguente codice:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{ //SMS if(buttonIndex == 0){ } //EMAIL if (buttonIndex == 1){ }else{ } } -(IBAction)emailAction{ UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Invia con" delegate:self cancelButtonTitle:@"Annulla" destructiveButtonTitle:nil otherButtonTitles:@"SMS", @"Email",nil]; actionSheet.actionSheetStyle = UIActionSheetStyleDefault; [actionSheet showInView:self.view]; [actionSheet release]; } |
Se hai trovato utili le informazioni su questo blog,
Fai una donazione!
Clicca sul bottone qui sotto o almeno clicca sul banner pubblicitario 🙂
Commenta