如何在按下操作时显示此内容?

时间:2014-05-16 12:45:14

标签: ios objective-c

如何从应用内的动作中显示此内容?我试过搜索谷歌但没有找到任何关于它的东西,不知道什么甚至会被调用。任何建议或教程链接都会很棒。

enter image description here

2 个答案:

答案 0 :(得分:4)

这是一张UIActionSheet。见this documentation。或者tutorial

答案 1 :(得分:2)

您可以使用UIActionSheet

- (IBAction)buttonPressed:(id)sender
{ 
     // Create an instance of your UIActionSheet setting the buttons and the delegate to self.
     UIActionSheet *actSheet = [[UIActionSheet alloc] initWithTitle:@""
                                                           delegate:self
                                                  cancelButtonTitle:@"Cancel"
                                            desctructionButtonTitle:@"Cancel"
                                                  otherButtonTitles:nil];
     [actSheet showInView];
}

请务必在UIActionSheetDelegate文件中加入interface,例如

@interface MySubClass : MySuperClass <UIActionSheetDelegate>

旁注

虽然您提供的图片是UIActionSheet,但它显示的按钮是UIImagePickerController类的一部分,如果是这些按钮,您可以查看{{1 }。class。