从应用程序内发送彩信和电子邮件
问题描述:
如何在iPhone上选择图像时使用电子邮件,彩信等弹出式菜单选项。从应用程序内发送彩信和电子邮件
另一件事,一个人怎么可以添加的东西到这个菜单例如Facebook分享,Twitter分享?这个菜单的名字是什么?
答
此菜单被称为UIActionSheet,您可以编写代码来确定自己显示的内容。基本上你通过一个actionHandler处理tap,然后你可以使用下面的代码来展示菜单。你可以明显地输入自己的NSString为Facebook,Twitter等
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle: [[NSString alloc] initWithFormat: @"How should we do something?"]
delegate: self cancelButtonTitle: @"Cancel" destructiveButtonTitle: nil
otherButtonTitles: @"Choice 1", @"Choice 2", @"Choice 3", nil];
[actionSheet setActionSheetStyle: UIActionSheetStyleBlackTranslucent];
// we need to those this in the main view otherwise the "z-order" with the tab bar takes precedence and "covers up" the lower half of the
// cancel button
[actionSheet showInView: [self view]];
[actionSheet release];
您还能够针对受委托通知登记处理的按钮使用UIActionSheetDelegate
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
很好,谢谢挖掘。顶部栏中的小回复按钮如何显示? – jarryd 2011-02-18 08:20:39