您的位置:首页 > 移动开发 > IOS开发

iOS --弹框1

2015-11-10 09:03 495 查看
//从底部弹出

UIAlertController *sheetController = [UIAlertController
alertControllerWithTitle:@"请选择图片"
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];

UIAlertAction *saveAction = [UIAlertAction
actionWithTitle:@"拍照"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {

NSLog(@"保存");

}];

UIAlertAction *deleteAction = [UIAlertAction
actionWithTitle:@"相册"
style:UIAlertActionStyleDestructive
handler:^(UIAlertAction *action) {

NSLog(@"删除");

}];

UIAlertAction *cancelAction = [UIAlertAction
actionWithTitle:@"取消"
style:UIAlertActionStyleCancel
handler:nil];

[sheetController addAction:saveAction];

[sheetController addAction:deleteAction];

[sheetController addAction:cancelAction];

[self
presentViewController:sheetController animated:YES
completion:nil];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: