美文网首页
AlertViewController的使用

AlertViewController的使用

作者: 刘振杰 | 来源:发表于2016-08-24 15:45 被阅读152次

UIAlertController  *alert=[UIAlertController alertControllerWithTitle:@"选择信誉度" message:nil preferredStyle:UIAlertControllerStyleActionSheet];

//设置按钮

UIAlertAction *btn2=[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

}];

[alert addAction:btn2];

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

//把按钮增加到alert上

[alert addAction:btn1];

//模态弹出

[self presentViewController:alert animated:YES completion:nil];

相关文章

网友评论

      本文标题:AlertViewController的使用

      本文链接:https://www.haomeiwen.com/subject/cckosttx.html