苹果的UIActionSheet文档让我感到困惑。首先,在iPad人机界面指南中,它说:
要了解有关在代码中使用操作表的详细信息,请参阅“使用弹出窗口显示内容”中的iPad编程指南。
但是在“使用弹出窗口显示内容”部分中,根本没有提及操作表!我错过了什么吗?
我的主要问题是:在iPad上,UIPopoverController和UIActionSheet之间有什么区别?如果UIActionSheet自动在UIPopoverController中呈现自身,则是否有任何使用UIActionSheet的理由?我看到它的代表和自动创建按钮使得代码行数更少,但从可用性的角度来看,是否存在差异?
此外,使用动画显示我的actionSheet根本不起作用。它的外观和行为与未使用动画呈现的actionSheet完全相同(这与我根本不使用actionSheet和UIPopoverController完全相同)。这是我的代码:
UIActionSheet *action = [[UIActionSheet alloc] initWithTitle:@"An unsaved property already exists. You must assign a name to this property before creating a new property. Would you like to:"
delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:@"Overwrite"
otherButtonTitles:@"Open unsaved property", nil];
[action showFromRect:CGRectMake(0, 0, 200, 200) inView:self.mainSplitViewController.view animated:NO];
如何获得一个类似于苹果文档中示例动画 actionSheet 的 actionSheet(来自地图应用程序,在其中将位置添加到联系人)?
我可能最终会使用警报而不是弹出窗口或操作表,但了解这一点仍然很有用。
谢谢!