有谁知道这个UIObject的名字? (图片里面)

时间:2015-02-27 09:11:10

标签: objective-c xcode

我试图在我的程序中添加类似这样的东西,但却忘了它的名字。 enter image description here

我正在谈论弹出的按钮"照片库" "拍摄照片​​或视频" "取消"

2 个答案:

答案 0 :(得分:1)

来自Cocoa touch的UIActionSheet类。

答案 1 :(得分:1)

它是UIAlertController,风格为UIAlertControllerStyleActionSheet。 你这样使用它:

UIAlertController *aC = [UIAlertController alertControllerWithTitle:@"Title"
                                                            message:@"Message"
                                                     preferredStyle:UIAlertControllerStyleActionSheet];

[aC addAction:[UIAlertAction actionWithTitle:@"Button 1"
                                       // Style can be default, destructive or cancel
                                       style:UIAlertActionStyleDefault
                                     handler:^(UIAlertAction *action) {
    // handler
}]];

// Add more actions (buttons) here if needed

// Assuming you're in your view controller,
// present the alert view controller like this:
[self presentViewController:aC animated:YES completion:nil];