Apple 的 UIActionSheet 文档让我感到困惑。首先,在 iPad 人机界面指南中,它说:
要了解有关在代码中使用操作表的更多信息,请参阅 iPad 编程指南中的“使用弹出框显示内容”。
但是在“使用弹出框显示内容”部分,它根本没有提到操作表!我在这里错过了什么吗?
我的主要问题是:在 iPad 上,UIPopoverController 和 UIActionSheet 有什么区别?如果 UIActionSheet 自动在 UIPopoverController 中显示自己,那么有任何理由使用 UIActionSheet 吗?我看到它的委托和按钮的自动创建如何减少代码行,但是从可用性 POV 来看,有区别吗?
此外,用动画显示我的 actionSheet 根本不起作用。它的外观和行为与没有动画的 actionSheet 完全一样(这与我只使用 UIPopoverController 而根本没有 actionSheet 完全一样)。这是我的代码:
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];
我如何获得一个看起来像 Apple 文档中的示例动画 actionSheet 的 actionSheet(来自地图应用程序,您可以在其中向联系人添加位置)?
我可能最终会为此使用警报而不是弹出框或操作表,但理解这一点仍然很有用。
谢谢!