我试图在我的程序中添加类似这样的东西,但却忘了它的名字。
我正在谈论弹出的按钮"照片库" "拍摄照片或视频" "取消"
答案 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];