代理:
UIActionSheetDelegate
UIActionSheet *m_actionsSheet;
//显示
m_actionsSheet = [[[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:nil otherButtonTitles:NSLocalizedString(@"Export To Library", nil),NSLocalizedString(@"Email", nil), nil] autorelease];
m_actionsSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[m_actionsSheet showInView:self.view];
#pragma mark - Action Sheet Delegate
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex {
if (actionSheet == m_actionsSheet) {
// Actions
self.actionsSheet = nil;
if (buttonIndex != actionSheet.cancelButtonIndex) {
if (buttonIndex == actionSheet.firstOtherButtonIndex) { //Export To Library
} else if (buttonIndex == actionSheet.firstOtherButtonIndex + 1) { //email
}
}
}
[self hideControlsAfterDelay]; // Continue as normal...
}